<p dir="ltr"><br>
s/this type of pages/this type of page/g</p>
<p dir="ltr">--<br>
Sent from my telephone.<br>
</p>
<div class="gmail_quote">On Feb 20, 2014 8:59 PM, "Lukas Fleischer" <<a href="mailto:cgit@cryptocrack.de">cgit@cryptocrack.de</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If time-to-live is set to zero, we don't need to regenerate the cache<br>
slots on every request. Instead, just skip the caching process and<br>
immediately provide the dynamically generated version of the page.<br>
Setting time-to-live to zero is useful when you want to disable caching<br>
for certain pages.<br>
<br>
Signed-off-by: Lukas Fleischer <<a href="mailto:cgit@cryptocrack.de">cgit@cryptocrack.de</a>><br>
---<br>
cache.c | 2 +-<br>
cgitrc.5.txt | 22 ++++++++++++++--------<br>
2 files changed, 15 insertions(+), 9 deletions(-)<br>
<br>
diff --git a/cache.c b/cache.c<br>
index 9e7eeb0..801e63f 100644<br>
--- a/cache.c<br>
+++ b/cache.c<br>
@@ -343,7 +343,7 @@ int cache_process(int size, const char *path, const char *key, int ttl,<br>
int result;<br>
<br>
/* If the cache is disabled, just generate the content */<br>
- if (size <= 0) {<br>
+ if (size <= 0 || ttl == 0) {<br>
fn();<br>
return 0;<br>
}<br>
diff --git a/cgitrc.5.txt b/cgitrc.5.txt<br>
index a437fc4..7158c10 100644<br>
--- a/cgitrc.5.txt<br>
+++ b/cgitrc.5.txt<br>
@@ -61,37 +61,43 @@ cache-root::<br>
cache-static-ttl::<br>
Number which specifies the time-to-live, in minutes, for the cached<br>
version of repository pages accessed with a fixed SHA1. Negative<br>
- values have infinite ttl. Default value: -1".<br>
+ values have infinite ttl, zero means that the cache is disabled for<br>
+ this type of pages. Default value: -1".<br>
<br>
cache-dynamic-ttl::<br>
Number which specifies the time-to-live, in minutes, for the cached<br>
version of repository pages accessed without a fixed SHA1. Negative<br>
- values have infinite ttl. Default value: "5".<br>
+ values have infinite ttl, zero means that the cache is disabled for this<br>
+ type of pages. Default value: "5".<br>
<br>
cache-repo-ttl::<br>
Number which specifies the time-to-live, in minutes, for the cached<br>
version of the repository summary page. Negative values have infinite<br>
- ttl. Default value: "5".<br>
+ ttl, zero means that the cache is disabled for this type of pages.<br>
+ Default value: "5".<br>
<br>
cache-root-ttl::<br>
Number which specifies the time-to-live, in minutes, for the cached<br>
version of the repository index page. Negative values have infinite<br>
- ttl. Default value: "5".<br>
+ ttl, zero means that the cache is disabled for this type of pages.<br>
+ Default value: "5".<br>
<br>
cache-scanrc-ttl::<br>
Number which specifies the time-to-live, in minutes, for the result<br>
of scanning a path for git repositories. Negative values have infinite<br>
- ttl. Default value: "15".<br>
+ ttl, zero means that the cache is disable for this type of pages.<br>
+ Default value: "15".<br>
<br>
cache-about-ttl::<br>
Number which specifies the time-to-live, in minutes, for the cached<br>
version of the repository about page. Negative values have infinite<br>
- ttl. Default value: "15".<br>
+ ttl, zero means that the cache is disable for this type of pages.<br>
+ Default value: "15".<br>
<br>
cache-snapshot-ttl::<br>
Number which specifies the time-to-live, in minutes, for the cached<br>
- version of snapshots. Negative values have infinite ttl. Default<br>
- value: "5".<br>
+ version of snapshots. Negative values have infinite ttl, zero means<br>
+ that the cache is disable for this type of pages. Default value: "5".<br>
<br>
cache-size::<br>
The maximum number of entries in the cgit cache. Default value: "0"<br>
--<br>
1.9.0<br>
<br>
_______________________________________________<br>
CGit mailing list<br>
<a href="mailto:CGit@lists.zx2c4.com">CGit@lists.zx2c4.com</a><br>
<a href="http://lists.zx2c4.com/mailman/listinfo/cgit" target="_blank">http://lists.zx2c4.com/mailman/listinfo/cgit</a><br>
</blockquote></div>