I have a website which is dependent on session and cookie. I want to get Varnish cache implemented on it.
When the browser is open the website has same session id, till the browser is closed. But the AGE value in header remains 0 . This AGE value describes if varnish is caching the page or not. 0 means its not caching.
To check Varnish caching is working or not,
curl -I domainnameis the command, I hit this through terminal, The header gives different PHPSESSIONID on every HIT and the value of AGE also remains 0.
Can't exactly determine as in what is not allowing site to be cached by Varnish.
Just to test I commented the session_start(), and here are the following observation.
On Browser
- The session id cookie was not created in browser.
- AGE still remained 0 for several hits on same page.
On Terminal
- The php session id was not shown in header response.
- Age value was 0 on first hit, but on later hits it kept getting incremental numeric value.
It seems that Varnish fails to cache on browser hits. Specially when Domain is specified.
Any Help How get the varnish cache working for session based website ?