[master] 6cb9465 Revamp descriptions of $default_(ttl,grace,keep)
Poul-Henning Kamp
phk at varnish-cache.org
Fri Oct 4 08:54:57 CEST 2013
commit 6cb9465478b798c9664898aa9733aaeb40865144
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Fri Oct 4 06:54:39 2013 +0000
Revamp descriptions of $default_(ttl,grace,keep)
diff --git a/bin/varnishd/mgt/mgt_param.c b/bin/varnishd/mgt/mgt_param.c
index 2c8b77a..8284a14 100644
--- a/bin/varnishd/mgt/mgt_param.c
+++ b/bin/varnishd/mgt/mgt_param.c
@@ -618,6 +618,10 @@ tweak_poolparam(struct cli *cli, const struct parspec *par, const char *arg)
* formatting will go haywire.
*/
+#define OBJ_STICKY_TEXT \
+ "\nNB: This parameter is evaluated only when objects are created." \
+ "To change it for all objects, restart or ban everything."
+
#define DELAYED_EFFECT_TEXT \
"\nNB: This parameter may take quite some time to take (full) effect."
@@ -701,6 +705,8 @@ mcf_param_show(struct cli *cli, const char * const *av, void *priv)
VCLI_Out(cli, "%-*s Default is %s\n",
margin, "", pp->def);
mcf_wrap(cli, pp->descr);
+ if (pp->flags & OBJ_STICKY)
+ mcf_wrap(cli, OBJ_STICKY_TEXT);
if (pp->flags & DELAYED_EFFECT)
mcf_wrap(cli, DELAYED_EFFECT_TEXT);
if (pp->flags & EXPERIMENTAL)
diff --git a/bin/varnishd/mgt/mgt_param.h b/bin/varnishd/mgt/mgt_param.h
index 4026bb9..64fccf1 100644
--- a/bin/varnishd/mgt/mgt_param.h
+++ b/bin/varnishd/mgt/mgt_param.h
@@ -46,6 +46,7 @@ struct parspec {
#define MUST_RELOAD (1<<3)
#define WIZARD (1<<4)
#define PROTECTED (1<<5)
+#define OBJ_STICKY (1<<6)
const char *def;
const char *units;
};
diff --git a/bin/varnishd/mgt/mgt_param_tbl.c b/bin/varnishd/mgt/mgt_param_tbl.c
index 6086c9c..d2aca5c 100644
--- a/bin/varnishd/mgt/mgt_param_tbl.c
+++ b/bin/varnishd/mgt/mgt_param_tbl.c
@@ -56,13 +56,25 @@ const struct parspec mgt_parspec[] = {
{ "default_ttl", tweak_timeout_double, &mgt_param.default_ttl,
0, UINT_MAX,
"The TTL assigned to objects if neither the backend nor "
- "the VCL code assigns one.\n"
- "Objects already cached will not be affected by changes "
- "made until they are fetched from the backend again.\n"
- "To force an immediate effect at the expense of a total "
- "flush of the cache use \"ban obj.http.date ~ .\"",
- 0,
+ "the VCL code assigns one.\n",
+ OBJ_STICKY,
"120", "seconds" },
+ { "default_grace", tweak_timeout_double, &mgt_param.default_grace,
+ 0, UINT_MAX,
+ "Default grace period. We will deliver an object "
+ "this long after it has expired, provided another thread "
+ "is attempting to get a new copy.\n",
+ OBJ_STICKY,
+ "10", "seconds" },
+ { "default_keep", tweak_timeout_double, &mgt_param.default_keep,
+ 0, UINT_MAX,
+ "Default keep period. We will keep a useless object "
+ "around this long, making it available for conditional "
+ "backend fetches. "
+ "That means that the object will be removed from the "
+ "cache at the end of ttl+grace+keep.",
+ OBJ_STICKY,
+ "0", "seconds" },
{ "workspace_client",
tweak_bytes_u, &mgt_param.workspace_client, 3072, UINT_MAX,
"Bytes of HTTP protocol workspace for clients HTTP req/resp."
@@ -148,24 +160,6 @@ const struct parspec mgt_parspec[] = {
"Maximum is 65535 bytes.",
0,
"255", "bytes" },
- { "default_grace", tweak_timeout_double, &mgt_param.default_grace,
- 0, UINT_MAX,
- "Default grace period. We will deliver an object "
- "this long after it has expired, provided another thread "
- "is attempting to get a new copy.\n"
- "Objects already cached will not be affected by changes "
- "made until they are fetched from the backend again.\n",
- DELAYED_EFFECT,
- "10", "seconds" },
- { "default_keep", tweak_timeout_double, &mgt_param.default_keep,
- 0, UINT_MAX,
- "Default keep period. We will keep a useless object "
- "around this long, making it available for conditional "
- "backend fetches. "
- "That means that the object will be removed from the "
- "cache at the end of ttl+grace+keep.",
- DELAYED_EFFECT,
- "0", "seconds" },
{ "timeout_idle", tweak_timeout_double, &mgt_param.timeout_idle,
0, UINT_MAX,
"Idle timeout for client connections.\n"
More information about the varnish-commit
mailing list