How to enable leverage browser caching in Plesk

Created:

2017-03-05 15:55:20 UTC

Modified:

2017-08-16 19:17:44 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to enable leverage browser caching in Plesk

Applicable to:

  • Plesk for Linux

Question

How to enable leverage browser caching in Plesk?

Answer

1. Find LoadModule path:

# find / -name mod_expires.so
/usr/lib64/httpd/modules/mod_expires.so

2. Create /etc/httpd/conf.d/expires.conf file:

# vi /etc/httpd/conf.d/expires.conf

3. Insert the following content in it ( modules/mod_expires.so path is taken from the 1 step, so if /usr/lib64/httpd/modules/mod_expires.so path was found in the 1 step, include modules/mod_expires.so in /etc/httpd/conf.d/expires.conf ):

LoadModule expires_module modules/mod_expires.so
ExpiresActive on
ExpiresDefault "access plus 14 days"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType text/css "now plus 1 month"
ExpiresByType image/ico "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 month"
ExpiresByType text/html "access plus 1 days"

4. Add the following to /etc/httpd/conf/httpd.conf :

FileETag None

5. Apply the configuration changes:

# service httpd reload

6. Validate Apache configuration:

# httpd -t

7. View the loaded Apache modules:

# httpd -M
Have more questions? Submit a request

5 Comments

Please sign in to leave a comment.