I tried curl -I domainname
and here is the response.
HTTP/1.1 200 OK
Date: Tue, 21 Apr 2015 14:49:09 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.3.3
Set-Cookie: PHPSESSID=kpgqqefkge38jlqc608hq12046; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Type: text/html; charset=UTF-8
X-Varnish: 294982
Age: 0
Via: 1.1 varnish-v4
Content-Length: 0
Connection: keep-alive
HTTP/1.1 200 OK
Date: Tue, 21 Apr 2015 14:49:10 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.3.3
Set-Cookie: PHPSESSID=onqvu51sggp70nla7ke5scgr61; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Type: text/html; charset=UTF-8
X-Varnish: 163920
Age: 0
Via: 1.1 varnish-v4
Connection: keep-alive
HTTP/1.1 200 OK
Date: Tue, 21 Apr 2015 14:49:10 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.3.3
Set-Cookie: PHPSESSID=s8sd6qufhjl9ki0dh8jc2nb206; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Type: text/html; charset=UTF-8
X-Varnish: 294985
Age: 0
Via: 1.1 varnish-v4
Content-Length: 0
Connection: keep-alive
The above response has following observations :
The PHPsessionID value keeps on changing at every HIT.
The Varnish Age value remain 0 . Which means that the site is not getting chached?
I have a website which requires use of session. As users are allowed to login and their details are kept in session.
Any way how to make the website get cached by Varnish ? Thank you!