Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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>
share|improve this question

2 Answers 2

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

share|improve this answer
    
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? –  Maciej Swic Dec 25 '12 at 15:12
    
Grep for word "Header" or "header" –  dr-evil Dec 25 '12 at 15:27
    
Just header('Location... –  Maciej Swic Dec 25 '12 at 15:29
    
Ok. You have to grep all site code (including .htaccess'es) and apache configs. –  dr-evil Dec 25 '12 at 15:32

Apparently it was related to me starting a php session.

Setting session_cache_limiter('public') solved it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.