mirror of
https://git.zx2c4.com/cgit
synced 2025-07-25 21:25:08 +02:00
Skip cache slot when time-to-live is zero
If time-to-live is set to zero, we don't need to regenerate the cache slots on every request. Instead, just skip the caching process and immediately provide the dynamically generated version of the page. Setting time-to-live to zero is useful when you want to disable caching for certain pages. Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
This commit is contained in:
parent
8033dc01f4
commit
6ceba453a2
2 changed files with 15 additions and 9 deletions
2
cache.c
2
cache.c
|
@ -343,7 +343,7 @@ int cache_process(int size, const char *path, const char *key, int ttl,
|
|||
int result;
|
||||
|
||||
/* If the cache is disabled, just generate the content */
|
||||
if (size <= 0) {
|
||||
if (size <= 0 || ttl == 0) {
|
||||
fn();
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue