|
diff --git a/cgit.c b/cgit.c index 3fc90bf..b943fe5 100644 --- a/ cgit.c+++ b/ cgit.c |
|
@@ -24,22 +24,24 @@ static int cgit_prepare_cache(struct cacheitem *item) |
24 | |
24 | |
25 | if (!cgit_repo) { |
25 | if (!cgit_repo) { |
26 | item->name = xstrdup(fmt("%s/index.html", cgit_cache_root)); |
26 | item->name = xstrdup(fmt("%s/index.html", cgit_cache_root)); |
27 | item->ttl = cgit_cache_root_ttl; |
27 | item->ttl = cgit_cache_root_ttl; |
28 | return 1; |
28 | return 1; |
29 | } |
29 | } |
30 | |
30 | |
31 | if (!cgit_cmd) { |
31 | if (!cgit_cmd) { |
32 | item->name = xstrdup(fmt("%s/%s/index.html", cgit_cache_root, |
32 | item->name = xstrdup(fmt("%s/%s/index.%s.html", cgit_cache_root, |
33 | cache_safe_filename(cgit_repo->url))); |
33 | cache_safe_filename(cgit_repo->url), |
| |
34 | cache_safe_filename(cgit_querystring))); |
34 | item->ttl = cgit_cache_repo_ttl; |
35 | item->ttl = cgit_cache_repo_ttl; |
35 | } else { |
36 | } else { |
36 | item->name = xstrdup(fmt("%s/%s/%s/%s.html", cgit_cache_root, |
37 | item->name = xstrdup(fmt("%s/%s/%s/%s.html", cgit_cache_root, |
37 | cache_safe_filename(cgit_repo->url), cgit_query_page, |
38 | cache_safe_filename(cgit_repo->url), |
| |
39 | cgit_query_page, |
38 | cache_safe_filename(cgit_querystring))); |
40 | cache_safe_filename(cgit_querystring))); |
39 | if (cgit_query_has_symref) |
41 | if (cgit_query_has_symref) |
40 | item->ttl = cgit_cache_dynamic_ttl; |
42 | item->ttl = cgit_cache_dynamic_ttl; |
41 | else if (cgit_query_has_sha1) |
43 | else if (cgit_query_has_sha1) |
42 | item->ttl = cgit_cache_static_ttl; |
44 | item->ttl = cgit_cache_static_ttl; |
43 | else |
45 | else |
44 | item->ttl = cgit_cache_repo_ttl; |
46 | item->ttl = cgit_cache_repo_ttl; |
45 | } |
47 | } |
|