Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-file
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-file
Commits
ea790f83
Commit
ea790f83
authored
Sep 29, 2019
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the example for .next_check() to suggest use for Cache-Control.
parent
99720eea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
12 deletions
+10
-12
README.rst
README.rst
+5
-6
vmod_file.vcc
src/vmod_file.vcc
+5
-6
No files found.
README.rst
View file @
ea790f83
...
@@ -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():
...
...
src/vmod_file.vcc
View file @
ea790f83
...
@@ -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()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment