diff --git a/cookbook/cache/varnish.rst b/cookbook/cache/varnish.rst index 48eb43c2592..da06add99f1 100644 --- a/cookbook/cache/varnish.rst +++ b/cookbook/cache/varnish.rst @@ -57,6 +57,14 @@ Symfony2 adds automatically: // For Varnish < 3.0 // esi; } + /* By default Varnish ignores Cache-Control: nocache + (https://www.varnish-cache.org/docs/3.0/tutorial/increasing_your_hitrate.html#cache-control), + so in order avoid caching it has to be done explicitly */ + if (beresp.http.Pragma ~ "no-cache" || + beresp.http.Cache-Control ~ "no-cache" || + beresp.http.Cache-Control ~ "private") { + return (hit_for_pass); + } } .. caution::