Innovate | Connect | Transform
ContactService statusUSD $

GICT knowledge base

How to Solve Leverage Browser Caching Warning in WordPress?

Published

WordPress

Leverage Browser Caching means storing static files of a website in visitor browser. The main reason for the leverage browsing caching is that the web-server doesn’t have the appropriate header in place. This types of issues can be resolved by adding expires heading codes in .htaccess files.

 

1) Login to cPanel.

2) Select the ‘File Manager’ menu under file section.

Leverage browser caching

 

3) Tick the checkbox ‘Show Hidden Files’ and click “Save” button.

Leverage browser caching

 

4) Find and edit the file ‘.htaccess’ under public_html.

Leverage browser caching

 

5) Paste the following codes in ‘.htaccess’ file.

## EXPIRES HEADER CACHING ##

ExpiresActive On

ExpiresByType image/jpg “access 1 year”

ExpiresByType image/jpeg “access 1 year”

ExpiresByType image/gif “access 1 year”

ExpiresByType image/png “access 1 year”

ExpiresByType text/css “access 1 month”

ExpiresByType application/pdf “access 1 month”

ExpiresByType application/javascript “access 1 month”

ExpiresByType application/x-javascript “access 1 month”

ExpiresByType application/x-shockwave-flash “access 1 month”

ExpiresByType image/x-icon “access 1 year”

ExpiresDefault “access 2 days”

## EXPIRES HEADER CACHING ##

 

That is how we can solve leverage browser caching warning in WordPress.

 

 

Related guides

Account services are unavailable until the production backend is configured.