Reputation: 393
We are rendering minified css / js through php with following expire headers
header('Expires:'.gmdate('D, d M Y H:i:s', 1407595380 + 3600 * 24 * 90).' GMT');
header('Cache-Control: public');
header('Last-Modified: 1407595380');
header('Content-type: text/css');
Response headers we are getting mentioned in-line
Cache-Control public
Connection Keep-Alive
Content-Encoding gzip
Content-Length 3224
Content-Type text/css
Date Mon, 11 Aug 2014 14:54:55 GMT
Expires Fri, 07 Nov 2014 14:43:00 GMT
Keep-Alive timeout=5, max=100
Last-Modified 1407595380
Pragma no-cache
Server Apache/2.2.22 (Ubuntu)
But every time i refresh my page , browser gives me 200 response code instead of 304. Browser is not using own cache for php generated minified files and rest css js having 304 code on subsequent requests.
Thanks
Upvotes: 0
Views: 1210
Reputation: 11
$timeToCache = 3600 * 24 * 90;
header('Expires:'.gmdate('D, d M Y H:i:s', 1407595380 + $timeToCache).' GMT');
header('Cache-Control: public');
header('Cache-Control: max-age='.$timeToCache);
header('Last-Modified: 1407595380');
header('Content-type: text/css');
header('Pragma: cache');
Upvotes: 1
Reputation: 11605
Pragma: no-cache
might give you clue.
Although it is for legacy HTTP/1.0, Try setting Pragma: cache
.
Upvotes: 0