Search code examples
phphttp-headerslast-modified

PHP Last-Modified header not sent?


So I have this at the very top of my PHP file:

<?php
// Set headers
header('Content-Type: text/html; charset=UTF-8');
header('Content-Style-Type: text/css');
header('Content-Script-Type: application/javascript');
header('HTTP/1.1 200 OK');
header('Content-language: en-US');
header('X-Powered-By: ');
header_remove('X-Powered-By');
header('Last-Modified: Tue, 01 Jan 2013 00:00:00 GMT');
header('Cache-Control: no-store, no-cache, max-age=0, must-revalidate');
header('Pragma: no-store, no-cache, max-age=0, must-revalidate');
header('Expires: Tue, 01 Jan 2013 00:00:00 GMT');
?>

So when I check the Firefox console's NET tab on my site's URL I don't see the Last-Modified header. Any suggestions?


Solution

  • You're telling the browser to cache nothing and he MUST revalidate everything. So the last-modified header doesn't matter.