Enable image caching in apache for better Google Page Speed results


High page speed and short page load times of your website are essential for good search engine rankings. To enable Image caching and http requests in apache, you need to enable the expires module on Ubunto or Debian. This module allows the apache web server to set HTTP headers. It sets the modification header for static assets like image and CSS files that do not change often.


a2enmod headers expires

Add the following directives inside the vhost file of the web site or at the end of the file /etc/apache2/apache2.conf to enable it globally.

Header set Cache-Control "max-age=3024000, public"
</FilesMatch

On ISPConfig 3 servers, this can be added in the “Apache Directives” field of the website instead. There is no apache reload required as ISPConfig takes care about that

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.