How to force browser cache on my website?

Issue:

When you check your website using http header tools you can see that your website is not optimize.

Reason:

You find that your website is not optimize and you have check with webpage tester that your website is does not have caching enable.

Solutions:

You may force your website to use caching that has been ready by our web server. Please add below script into your .htaccess file:

ExpiresActive On
ExpiresDefault A1800

#   1 Week
<FilesMatch "\.(ico|gif|jpg|jpeg|png|flv|ttf)$">
Header set Cache-Control "max-age=604800"
</FilesMatch>
#   1 Week
<FilesMatch "\.(js|css|pdf|txt|swf)$">
Header set Cache-Control "max-age=604800"
</FilesMatch>
#   1 Hour
<FilesMatch "\.(html|htm|php|php3|)$">
Header set Cache-Control "max-age=3600"
</FilesMatch>

Was this answer helpful?

Also Read

What is SSH?

SSH (Secure Shell) is a secure method for logging into a server remotely and giving the server...

How do I configure hotlink protection?

Login to cPanel. Locate and click on the "Hotlink Protection" icon within the "Security"...

I've updated my website, but still see the old version. What's going on?

You must Refresh your browser. Your computer holds a copy of your website in 'cache'. Things to...

Zimbra - Some mailbox did not receive email even when logs says sent

Issue:Some user complaint that did not receive email. however, zimbra.log shows that the email...