I have been asked to work on a corporate website a previous employee had created. The site is on shared GoDaddy hosting. One of the first things I noticed (after the 140KB JPEG on the front page, which is now 22KB for no noticeable degradation) was that none of the HTML pages being served were getting cached. Turns out every PHP file on this website is sending the following headers:
Pragma: no-cache Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
The 1981 expiry date is notable as it is an odd day/time to choose arbitrarily. This is not affecting other MIME types, just text/html (all of which are PHP-generated). As the server is running PHP 5.2 there's no header_remove() function. I have tried overriding them in PHP by using empty values:
header("Pragma: "); header("Expires: "); header("Cache-Control: ");
This didn't work. So I tried removing them via .htaccess:
<FilesMatch "\.php$"> Header unset Pragma Header unset Expires Header unset Cache-Control </FilesMatch>
This also failed. I am beginning to suspect a GoDaddy shared hosting misconfiguration that I won't be able to fix :-/
Has anyone seen this before or got other ideas I can try?