To configure caching, go to "Files → File Manager "


Go to "public_html " folder.


By default, the ".htaccess " file is hidden

To fix this, click on "Settings " and check "Show hidden files (dotfiles) ".


Next, select our .htaccess and click "Edit "


In the window that will appear let's click "Disable encoding check " and click "Edit ".


Let's specify the following values at the beginning of the file:

<IfModule mod_expires.c>  

ExpiresActive On  

ExpiresByType application/javascript "access plus 10 days"  

ExpiresByType text/javascript "access plus 10 days"  

ExpiresByType text/css "access plus 10 days"  

ExpiresByType image/gif "access plus 10 days"  

ExpiresByType image/jpeg "access plus 10 days"  

ExpiresByType image/png "access plus 10 days"  


Then you can click the "Save changes " button.


In this code, the caching term specified is "access plus ". We can set a longer term for a month or even a year if we want.

If, on the contrary, we need to disable caching of some files, then simply don't add them to the list. Let's write the following code in file ".htaccess ", correcting our own actual changes.

<FilesMatch ".(pl|php|cgi|spl|scgi|fcgi)$">  

Header unset Cache-Control  

Updated July 31, 2018