Caching is done to speed up your website and alleviate the load on the server overall. Next to gzip-compression, caching is one of the most popular methods of web-optimization.

How to enable caching in cPanel

  1. Log into cPanel
  2. On the dashboard, click on File manager.file_manager
  3. Go to the public_html folder.public_html
  4. By default, .htaccess is hidden. So click the Settings button and check the Show hidden files (dotfiles) mark.settings
  5. Now click on .htaccess and click Edithtaccess
  6. Add 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"
    
    </IfModule>
  7. After you are done with the file, click on Save changes.save

How to enable caching in ISPmanager

  1. Click on the WWW-domains in the ISPmanager’s dashboard.
  2. Click on the domain you need to cache and click on Edit.edit
  3. Check the Cache configuration option and select the cache period.cache
  4. Click  to apply the new settings.
Tagged: