Include querystring as part of cached filename for repo summary page
When adding support for the h parameter to the summary page (passing current branch between pages), the builtin cache returned basically random results for summary page since the cached filename didn't honour the querystring. This fixes the issue for now, but someday it might be worthwhile to generate 'canonical' filenames in the cache for all pages, i.e. something a bit more clever than just including the querystring. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
这个提交包含在:
父节点
b8be028a30
当前提交
7d6ee4ee8a
10
cgit.c
10
cgit.c
@ -29,13 +29,15 @@ static int cgit_prepare_cache(struct cacheitem *item)
|
||||
}
|
||||
|
||||
if (!cgit_cmd) {
|
||||
item->name = xstrdup(fmt("%s/%s/index.html", cgit_cache_root,
|
||||
cache_safe_filename(cgit_repo->url)));
|
||||
item->name = xstrdup(fmt("%s/%s/index.%s.html", cgit_cache_root,
|
||||
cache_safe_filename(cgit_repo->url),
|
||||
cache_safe_filename(cgit_querystring)));
|
||||
item->ttl = cgit_cache_repo_ttl;
|
||||
} else {
|
||||
item->name = xstrdup(fmt("%s/%s/%s/%s.html", cgit_cache_root,
|
||||
cache_safe_filename(cgit_repo->url), cgit_query_page,
|
||||
cache_safe_filename(cgit_querystring)));
|
||||
cache_safe_filename(cgit_repo->url),
|
||||
cgit_query_page,
|
||||
cache_safe_filename(cgit_querystring)));
|
||||
if (cgit_query_has_symref)
|
||||
item->ttl = cgit_cache_dynamic_ttl;
|
||||
else if (cgit_query_has_sha1)
|
||||
|
正在加载...
在新工单中引用
屏蔽一个用户