Search code examples
apachecache-control

Apache suddenly doesn't send expires anymore


I've started to play a little bit with the headers in my virtual host file. and something strange happened.

I used the following conf:

<VirtualHost *:80>
        ServerAdmin webmaster@domain.com
        ServerAlias *.domain.com
        ServerName domain.com

        DocumentRoot /var/www/dir/

        ErrorLog logs/dir_error.log
        LogLevel warn

        CustomLog logs/dir_access.log combined
        ServerSignature On
</VirtualHost>

There's really nothing here. But ever since I added a "Header set Cache-Control" suddenly I stopped receiving the Expires - so I removed this line, and since I removed it - I don't receive in "curl" command neither Expires or Cache-Control ( which were sent before ).

Now, other virtual hosts files - send it by default ( no special conf there as well and nothing that I configured for the headers .. ).

I really not sure what happened here, how do I bring it back where Apache send dynamically those headers ?


Solution

  • Solved !

    The problem was in my head I guess, forgot that I'm going through a CDN which generates the Expires and Cache-Controls by default.

    This is why it worked for a couple of sites and others it didn't ... :)