Using mod_expire apache server

I am using Apache 2.2.20. I set expire_mod as "access plus 5 minutes". I am checking the header using some kind of website, and I am sure that the header has an expire directory. However, when I use tcpdump to track network traffic, I still see packet transfers when I reload a web page using Firefox, which should not expire. Does anyone know the reason for this? Thanks.

+4
source share
1 answer

When you click the "reload" button of your browser, the browser assumes that it should try and reload all elements of the page.

Your mod_expires parameters are configured correctly. However, this will not stop the browser from trying: when you click the reload button, a request for each element will be sent anyway with the If-Modified-Since header, but since it has not been changed on the Apache side, Apache will return 304 Not modified .

So, you see traffic, not a full page reload. You can attest to this using the same tool that was used to capture the headers to confirm that keepalive is working (and by the way, the maximum age of 5 minutes is low).

+2
source

Source: https://habr.com/ru/post/1387458/


All Articles