This VCL configuration removes the expires header from backend responses if their TTL is too short, sets the cache-control header to max-age of 900 seconds for clients, sets the backend response TTL to 1 week for Varnish, and in vcl_deliver resets the age header to 0 if the magic marker is present to indicate the object is fresh.
This VCL configuration removes the expires header from backend responses if their TTL is too short, sets the cache-control header to max-age of 900 seconds for clients, sets the backend response TTL to 1 week for Varnish, and in vcl_deliver resets the age header to 0 if the magic marker is present to indicate the object is fresh.
This VCL configuration removes the expires header from backend responses if their TTL is too short, sets the cache-control header to max-age of 900 seconds for clients, sets the backend response TTL to 1 week for Varnish, and in vcl_deliver resets the age header to 0 if the magic marker is present to indicate the object is fresh.
/* Remove Expires from backend, it's not long enough */ unset beresp.http.expires; /* Set the clients TTL on this object */ set beresp.http.cache-control = "max-age=900"; /* Set how long Varnish will keep it */ set beresp.ttl = 1w; /* marker for vcl_deliver to reset Age: */ set beresp.http.magicmarker = "1"; } } sub vcl_deliver { if (resp.http.magicmarker) { /* Remove the magic marker */ unset resp.http.magicmarker; /* By definition we have a fresh object */ set resp.http.age = "0"; } }