Varnish cache and PHP session; setting header?
- by StCee
Varnish by default would not cache page with cookies. I read on some posts that one workaround for PHP pages is to set
header('Cache-Control: public, s-maxage=60');
in php pages. But would it makes Varnish cache the page with the session cookie? Session is started on that page, and although there is nothing personal on that page, I would still want the session to persist in case the user would do something private later.
So is there a way to cache the page without the session cookie? And still be able to pass session between pages?
I can imagine some sort of weird solution with hidden form, but I would prefer if it can be done with VCL configuration or header setting. Thanks a lot!