My PHP code is:
$expires_date = date('D, j FYH:i:s', strtotime('now + 10 years')) . ' GMT'; header("Expires: $expires_date"); header('Content-type: text/javascript'); echo 'hello world';
When I check the response headers, I see the following:
Expires:Thu, 01 Jan 1970 00:00:00 GMT
What am I doing wrong?
UPDATE:
Just experimented, but it seems like I can't even turn off Expires via header_remove('Expires'); . I still see the date of 1970.
UPDATE:
My answer headers:
Cache-Control:private Connection:Keep-Alive Content-Encoding:gzip Content-Length:74 Content-Type:text/javascript Date:Wed, 17 Oct 2012 22:40:45 GMT Expires:Thu, 01 Jan 1970 00:00:00 GMT Keep-Alive:timeout=5, max=98 Server:Apache/2.2.21 (Win32) PHP/5.3.9 Vary:Accept-Encoding X-Powered-By:PHP/5.3.9
Stackoverflownewbie
source share