Leverage Browser Caching using .htaccess – wptip #14

One of the most common issues regarding performance in WordPress sites is the cache, Google and GTMetrix those tools always says you need to increase your cache performance.

Fetching resources over the network is both slow and expensive: the download may require multiple roundtrips between the client and server, which delays processing and may block rendering of page content, and also incurs data costs for the visitor. All server responses should specify a caching policy to help the client determine if and when it can reuse a previously fetched response.

Source: Google Page Speed Insights

To deal with this issue you can use the code below adding it to your .htaccess file.

References:

https://gtmetrix.com/leverage-browser-caching.html

https://developers.google.com/speed/docs/insights/LeverageBrowserCaching

Posted by Donini

WordPress Developer very involved with the community.