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>
This commit is contained in:
父節點
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)
|
||||
|
載入中…
新增問題並參考
Block a user