1

I recently set up an Ubuntu 12.04 server with the default LAMP task. Also added virtualmin.

All requests to apache return this in the headers.

Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0

How/where do i set cache-control to something more sensible to allow browsers to cache content?

Tried putting this in the .htaccess to no avail. mod_expires is enabled. The result is double Cache-Control headers!

<IfModule mod_headers.c>
  Header add "Cache-Control" "max-age=3600"
</IfModule>
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 3600 seconds"
</IfModule>

2 Answers 2

1

Apparently it was related to me starting a php session.

Setting session_cache_limiter('public') solved it. You can add it in php.ini or in your script.

0

Looks like your site generating these headers. Check it's code.

4
  • Just searched the entire site in Coda for the word "cache", it's not there and i wrote it all myself using no external libraries. Any other clues please? Dec 25, 2012 at 15:12
  • Grep for word "Header" or "header"
    – dr-evil
    Dec 25, 2012 at 15:27
  • Just header('Location... Dec 25, 2012 at 15:29
  • Ok. You have to grep all site code (including .htaccess'es) and apache configs.
    – dr-evil
    Dec 25, 2012 at 15:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .