Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache not sending Last-Modified header even if explicitly set

Tags:

apache

I have a problem with the Last-Modified header.

I created a simple test page:

<?
header('Last-Modified: Thu, 14 Feb 2013 12:41:31 GMT');
?>

When I open this test page with my browser, if I check the headers there's no Last-Modified header. All the other standard headers are set correctly. Anyway, if I access the test page with https, the Last-Modified header is set.

I also tried the same test on another server, and I can see the header correctly set even without https.

So, what could block/unset the header on the first server? I'm not including the httpd.conf file because is very long. I'll just include the caching section, even if I don't see anything wrong or related to this problem:

ServerSignature Off
ServerTokens Prod

Header unset ETag
FileETag None
<FilesMatch "(?i)^.*\.(ico|flv|jpe?g|png|gif|js|css).*$">
    Header set Cache-Control "public, no-transform"
    Header unset Vary:
</FilesMatch>
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault A2592000
    ExpiresByType text/css "access plus 1 week"
    ExpiresByType text/plain "access plus 1 month"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType application/x-javascript "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 year"
</IfModule>

Thanks in advance

like image 968
Lorenzo Marcon Avatar asked Mar 14 '13 10:03

Lorenzo Marcon


1 Answers

try

ssi off;

in nginx config for this domain

like image 141
dmitry.stas Avatar answered Dec 26 '22 13:12

dmitry.stas