summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2007-06-18 21:17:24 +0200
committerLars Hjemli <hjemli@gmail.com>2007-06-18 21:17:24 +0200
commit7d6ee4ee8a2c79802a78bc09c0e1e96a7a82de78 (patch)
tree0e337b6c314454614a54234b1ef3b0595ec05471
parentb8be028a309381b83abe924f5e8e01cf02b121a2 (diff)
downloadcgit-7d6ee4ee8a2c79802a78bc09c0e1e96a7a82de78.tar.gz
cgit-7d6ee4ee8a2c79802a78bc09c0e1e96a7a82de78.tar.bz2
cgit-7d6ee4ee8a2c79802a78bc09c0e1e96a7a82de78.zip
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>
-rw-r--r--cgit.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/cgit.c b/cgit.c
index 3fc90bf..b943fe5 100644
--- a/cgit.c
+++ b/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)
1'>Add small wrapper to C-gettextRené 'Necoro' Neumann2-1/+22 2009-08-31Update messages.potRené 'Necoro' Neumann1-42/+94 2009-08-31Removed the gtk- strings from translationsRené 'Necoro' Neumann7-3639/+3479 2009-08-31Removed the 'translatable' attribute from 'gtk-*' stringsRené 'Necoro' Neumann5-11/+11 2009-08-31Removed TODO. Renamed ChangeLog to TODORené 'Necoro' Neumann2-40/+0 2009-08-27Only import stuff if necessaryRené 'Necoro' Neumann1-8/+8 2009-08-25Release the threadQueue-Lock in syncv0.13René 'Necoro' Neumann1-0/+1 2009-08-25Updated portugese translationAlberto Federman Neto1-650/+687 2009-08-15Update spanish translationDaniel Halens1-245/+258 2009-08-15Use boolean flags instead of obscure C flags for ipc.MessageQueueRené 'Necoro' Neumann3-13/+15 2009-08-15TypoRené 'Necoro' Neumann1-1/+1 2009-08-15Enhanced the extensions.shRené 'Necoro' Neumann1-3/+8 2009-08-15Move eix-format to correct locationRené 'Necoro' Neumann1-0/+0