Commit ea790f83 authored by Geoff Simmons's avatar Geoff Simmons

Change the example for .next_check() to suggest use for Cache-Control.

parent 99720eea
...@@ -445,13 +445,12 @@ Return the time remaining until the next check will be performed. ...@@ -445,13 +445,12 @@ Return the time remaining until the next check will be performed.
Example:: Example::
import vtc; import std;
# If an update is pending within the next second, wait for it. # Set the downstream caching TTL to the time remaining until the
if (synth_body.next_check() < 1s) { # next update check.
vtc.sleep(1s); set resp.http.Cache-Control = "public, max-age="
synth_body.synth(); + std.integer(duration=rdr.next_check());
}
.. _file.version(): .. _file.version():
......
...@@ -404,13 +404,12 @@ Return the time remaining until the next check will be performed. ...@@ -404,13 +404,12 @@ Return the time remaining until the next check will be performed.
Example:: Example::
import vtc; import std;
# If an update is pending within the next second, wait for it. # Set the downstream caching TTL to the time remaining until the
if (synth_body.next_check() < 1s) { # next update check.
vtc.sleep(1s); set resp.http.Cache-Control = "public, max-age="
synth_body.synth(); + std.integer(duration=rdr.next_check());
}
$Function STRING version() $Function STRING version()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment