Enable Caching In Apache

Home » CentOS » Enable Caching In Apache
CentOS No Comments

hey all,

I am serving up a couple of sites using apache with varnish sitting in front of it.

When I check the headers for the site, this is what I’m seeing:

[root@ops:~] #curl -I http://ref.mydomain.com/
HTTP/1.1 200 OK
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.6.0-dev Set-Cookie: PHPSESSID=rqetkvi6l54819fffdivkppo90; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: *no-store, no-cache,* must-revalidate, post-check=0, pre-check=0
Content-Type: text/html; charset=UTF-8
Content-Length: 55548
Accept-Ranges: bytes Date: Mon, 07 Jul 2014 20:46:32 GMT
X-Varnish: 594446632
Age: 0
Via: 1.1 varnish Connection: close

I’ve tried setting these cache related directives but so far had no luck in getting the site to be cache enabled:

#48 Hours

Header set Cache-Control “max-age2800, public, must-revalidate”

# 2 HOURS

Header set Cache-Control “max-age`4800, public”

Header unset Pragma

How can I set the cache directive settings in apache that would allow this site to be cached?

Thanks Tim