Speed up your site with client side caching

OVERVIEW:

Client side caching enables your visitors to cache your content to reduce waste on global network resources, including your own server’s bandwidth. This speeds up your site by reducing the load/requests.  Google rewards sites that make use of this.

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

WARNING:  Make a backup of your htaccess file first so you can revert to your working file in the event something goes wrong.

Add the following text to your .htaccess file:

# Begin CACHE CONTROL SETTINGS
## EXPIRES CACHING ##
ExpiresActive On
ExpiresByType image/jpg "access 1 month"
ExpiresByType image/jpeg "access 1 month"
ExpiresByType image/gif "access 1 month"
ExpiresByType image/png "access 1 month"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 month"
Header append Vary: Accept-Encoding

# Expires after 1800 seconds, change this to how you see fit
filesMatch ".(css|htm|html)$"
Header set Cache-Control "max-age=1800"

ExpiresDefault "access plus 7200 seconds"
# End CACHE CONTROL SETTINGS

After setting the defaults above, you may wish to exclude certain specific files, like status.php that update for specific users. Please see the following ADVANCED setup examples.
Advanced Cache Control

Leverage Browser Caching

M3Server.com – WordPress Hosting Plans

Posted in FAQ and tagged , , .