From c7863324e02d875e7910ac4f41cb52ab4d1c449d Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 3 Nov 2006 19:56:55 +0100 Subject: [PATCH] Support for document.cache.interval (set it to -1) and rename it ...to document.cache.revalidation_interval. Moreover, -1 is the default now. --- src/cache/cache.c | 5 +++-- src/config/options.inc | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/cache/cache.c b/src/cache/cache.c index 7dc67db0..39d027ee 100644 --- a/src/cache/cache.c +++ b/src/cache/cache.c @@ -196,8 +196,9 @@ get_validated_cache_entry(struct uri *uri, enum cache_mode cache_mode) if (cached->cache_mode <= CACHE_MODE_CHECK_IF_MODIFIED && cache_mode <= CACHE_MODE_CHECK_IF_MODIFIED - && (cached->last_modified || cached->etag)) { - if (cached->seconds + get_opt_int("document.cache.interval") < time(NULL)) + && (cached->last_modified || cached->etag) + && get_opt_int("document.cache.revalidation_interval") >= 0) { + if (cached->seconds + get_opt_int("document.cache.revalidation_interval") < time(NULL)) return NULL; } diff --git a/src/config/options.inc b/src/config/options.inc index fc5d5838..5f662f66 100644 --- a/src/config/options.inc +++ b/src/config/options.inc @@ -502,10 +502,11 @@ static struct option_info config_options_info[] = { "is always cached, even if it is over the memory cache size\n" "threshold. (Then of course no other documents can be cached.)")), -/* FIXME: Write more. */ - INIT_OPT_INT("document.cache", N_("Interval"), - "interval", 0, 0, 86400, 600, - N_("Interval between requests for the same document in seconds.")), + /* FIXME: Write more. */ + INIT_OPT_INT("document.cache", N_("revalidation_Interval"), + "revalidation_interval", -1, 0, 86400, -1, + N_("Interval (in seconds) between a server is poked about changes in an\n" + "already cached document.")), INIT_OPT_TREE("document.cache", N_("Memory cache"), "memory", 0,