Varnish4 + Symfony2 is not caching

Dridi Boukelmoune dridi.boukelmoune at zenika.com
Mon Dec 15 16:08:52 CET 2014


Does Varnish 4 honor the Cache-Control's "no-cache"? IIRC Varnish 3
will cache such responses unless you choose not to.

I'm not including Set-Cookie headers when I say "such responses".

Dridi

On Mon, Dec 15, 2014 at 12:04 PM, MAGNIEN, Thierry
<thierry.magnien at sfr.com> wrote:
> Hi Stephan,
>
> With such headers, Varnish will only do what it has to :
>
> < Set-Cookie: PHPSESSID=0hel5b796j5eddr0qumq6ie344; path=/
> < Cache-Control: no-cache
> < Set-Cookie: hl=fr; expires=Tue, 15-Dec-2015 10:46:31 GMT; path=/
>
> Not only Varnish won't cache responses with set-cookie headers, unless explicitly told to in VCL, but the Cache-Control header tells Varnish not to cache...
>
> Regards,
> Thierry
>
> -----Message d'origine-----
> De : varnish-misc-bounces+thierry.magnien=sfr.com at varnish-cache.org [mailto:varnish-misc-bounces+thierry.magnien=sfr.com at varnish-cache.org] De la part de Stephan Alz
> Envoyé : lundi 15 décembre 2014 11:48
> À : varnish-misc at varnish-cache.org
> Objet : Varnish4 + Symfony2 is not caching
>
> Hello Folks
>
> I have a 4.0.2-1~wheezy + Symfony2 on Apache setup on 2 different linux hosts.
>
> Could anybody tell me what is wrong with the following configuration:
>
> http://pastebin.com/DzFrQijG
>
> When I try the url with curl I get:
>
> < HTTP/1.1 200 OK
> < Date: Mon, 15 Dec 2014 10:46:31 GMT
> < Server: Apache/2.2.22 (Debian)
> < Vary: Host,Accept-Encoding
> < Set-Cookie: PHPSESSID=0hel5b796j5eddr0qumq6ie344; path=/
> < Cache-Control: no-cache
> < Set-Cookie: hl=fr; expires=Tue, 15-Dec-2015 10:46:31 GMT; path=/
> < Content-Type: text/html; charset=UTF-8
> < X-Varnish: 32776
> < Age: 0
> < Via: 1.1 varnish-v4
> < X-Cache: MISS
> < X-Cache-Hits: 0
> < Transfer-Encoding: chunked
> < Accept-Ranges: bytes
>
> X-Cache is always miss for the pages, which means Varnish does not do it's job.
>
> Thank you,
>
> Stephan
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc



More information about the varnish-misc mailing list