Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
salt-state
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FFFFM
salt-state
Commits
bbb80d17
Commit
bbb80d17
authored
4 years ago
by
skorpy
Browse files
Options
Downloads
Patches
Plain Diff
grafana/varnish: update config
parent
959852dd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#28402
passed
4 years ago
Stage: lint
Stage: highstate
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
grafana/files/varnish-grafana.vcl.j2
+19
-12
19 additions, 12 deletions
grafana/files/varnish-grafana.vcl.j2
with
19 additions
and
12 deletions
grafana/files/varnish-grafana.vcl.j2
+
19
−
12
View file @
bbb80d17
...
...
@@ -103,29 +103,36 @@ sub vcl_backend_response {
# and other mistakes your backend does.
unset beresp.http.Set-Cookie;
unset beresp.http.Cookie;
unset beresp.http.pragma;
unset beresp.http.cache-control;
unset beresp.http.Pragma;
unset beresp.http.Cache-Control;
unset beresp.http.Expires;
unset beresp.http.Vary;
# set beresp.ttl = 120s;
set beresp.ttl = 600s;
unset beresp.http.Last-Modified;
unset beresp.http.ETag;
unset beresp.http.expires;
set beresp.http.cache-control = "max-age=120";
set beresp.ttl = 10s;
if(beresp.status == 200) {
set beresp.ttl = 600s;
}
}
sub vcl_deliver {
# Happens when we have all the pieces we need, and are about to send the
# response to the client.
#
# You can do accounting or modifying the final object here.
/*
* generic synthetic handler
*/
set resp.http.Date = now;
unset resp.http.via;
unset resp.http.x-varnish;
unset resp.http.Server;
unset resp.http.X-Varnish;
unset resp.http.Date;
unset resp.http.Via;
unset resp.http.Age;
set resp.http.Vary = "Accept-Encoding";
set resp.http.Server = "nginx";
set resp.http.Date = now;
set resp.http.Cache-Control = "max-age=120";
set resp.http.Expires = "" + (now + (std.duration("120s", 120s)));
set resp.http.grace = req.http.grace;
# could be useful to know if the object was in cache or not
if (obj.hits > 0) {
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment