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.
Example::
import vtc;
import std;
# If an update is pending within the next second, wait for it.
if (synth_body.next_check() < 1s) {
vtc.sleep(1s);
synth_body.synth();
}
# Set the downstream caching TTL to the time remaining until the
# next update check.
set resp.http.Cache-Control = "public, max-age="
+ std.integer(duration=rdr.next_check());
.. _file.version():
......
......@@ -404,13 +404,12 @@ Return the time remaining until the next check will be performed.
Example::
import vtc;
import std;
# If an update is pending within the next second, wait for it.
if (synth_body.next_check() < 1s) {
vtc.sleep(1s);
synth_body.synth();
}
# Set the downstream caching TTL to the time remaining until the
# next update check.
set resp.http.Cache-Control = "public, max-age="
+ std.integer(duration=rdr.next_check());
$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