configuration - What is the difference between beresp.grace & obj.grace -


in setting default.vcl file (varnish 3) i'm seeing different recommendations vcl_fetch use either beresp.grace or obj.grace. difference?

https://www.varnish-cache.org/docs/3.0/reference/vcl.html obj.grace object's grace period in seconds. obj.grace writable. beresp.grace set period enable grace.

sounds pretty same.

should used https://www.varnish-software.com/static/book/saving_a_request.html set beresp.ttl=1m; set req.grace = 30s; set beresp.grace = 1h;

i'd clarity. ideas on ttl useful too. sadly many of docs still v2: http://drupal.org/node/1823970

the 2 used in different place in vcl code.

using typical examples of (v3) use, difference this. (substitute obj req).

sub vcl_fetch {    set beresp.grace = 1h; } 

this code telling varnish mark cache objects being available use 1 hour.

whereas code:

sub vcl_recv {   if (req.backend.healthy) {     set req.grace = 30s;   } else {     set req.grace = 1h;   } } 

...is telling varnish use marked objects time specified, based on (in case) backend healthy.

ttl how long item cached for, , unless have particular (or odd) requirements best set caching headers in application or webserver layer).

the time need set ttl in vcl if want different headers are, or if need silently (not passing headers requesting browser) extend time objects can cached.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -