How to set an expiry date or a maximum age?

I cant fix this any help here pls ?

Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network.

Welcome to the forums, @csgoboosting.

You can set this in your .htaccess file.


# Enable the mod_expires module
ExpiresActive On
# Set expiration date to 1 month for all style sheets and images
ExpiresByType text/css "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
# Set expiration date to 1 week for all HTML pages
ExpiresByType text/html "access plus 1 week"
ExpiresByType application/xhtml+xml "access plus 1 week"  

You can, of course, change the period set to suit your own requirements.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.