1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Use the If-Modified-Since HTTP header
This guide concerns the HTTP header "If-Modified-Since" used to check if a resource has been modified since the last time it was retrieved by a client. This helps save bandwidth and speed up page loading by avoiding the retransmission of unchanged static resources.
Using the Header
Here's how you can use it using directives from the mod_expires module in the .htaccess file at the root of your site directory (/web or /sites/domain.xyz, for example):
- Open or create the .htaccess file at the root
- Enter the following code:
- Then enter your commands, for example:
ExpiresByType text/html "access plus 1 week"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
- Finish by closing the tag:
- Save the .htaccess file