Knowledgebase

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>
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to install WordPress by using Plesk

Step 1 Login to the Plesk Panel. Then, from the hosting servers menu that located in the left,...

How to configure authentication email by using cPanel

First, you need to login the cPanel page. In the Mail section, click Authentication.   Domain...

How do I configure hotlink protection?

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

Files fail FTP transfer

When uploading many files at once (a CMS, for example), it is not uncommon for a few of the files...

How do I block an IP address from accessing my site?

If you wish to ban a user from accessing your website in any way, the best way to do this is to...