WebHostingPeople Blog

How Can We Help?

How to Solve Leverage Browser Caching Warning in WordPress?

You are here:

Leverage Browser Caching refers to the practice of storing static information of a website in the browser of the user. The main reason for the leverage browser caching issue is the absence of appropriate headers on the web server. Such problems can be addressed by adding expires header codes in the .htaccess file.

1) Begin by logging in to cPanel.

2) Navigate to the ‘File Manager’ option within the file section.

Leverage Browser Caching

3) Check the box for ‘Show Hidden Files’ and click the “Save” button.

Leverage Browser Caching

4) Locate and edit the file named ‘.htaccess’ in the public_html directory.

Leverage Browser Caching

5) Insert the following codes into the ‘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 ##

By following these steps, the leverage browser caching warning in WordPress can be successfully resolved.

Post Your Comment