Title: Leverage browser caching
Last modified: August 31, 2016

---

# Leverage browser caching

 *  [rainman50](https://wordpress.org/support/users/rainman50/)
 * (@rainman50)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/leverage-browser-caching-30/)
 * Google page speed indicates I should leverage browser caching for google maps.
 * Consider Fixing:
    Leverage browser caching Setting an expiry date or a maximum
   age in the HTTP headers for static resources instructs the browser to load previously
   downloaded resources from local disk rather than over the network.
 * Leverage browser caching for the following cacheable resources:
    [http://maps.google.com/maps/api/js?sensor=false](http://maps.google.com/maps/api/js?sensor=false)(
   30 minutes)
 * Can I manually add code to .htaccess file and if so, recommended code to add?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Reagan Lynch](https://wordpress.org/support/users/rdlynch/)
 * (@rdlynch)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/leverage-browser-caching-30/#post-7006331)
 * Try this sample code in your .htaccess file. Be sure to back that file up or 
   make a copy before replacing it with this code. Add this code at the top of the
   file. Note also that this code is for almost every type of asset on your site(
   e.g. images, css, js, etc.).
 *     ```
       <IfModule mod_expires.c>
       # Enable expirations
       ExpiresActive On
       # My favicon
       ExpiresByType image/x-icon "access plus 1 year"
       # Images
       ExpiresByType image/gif "access plus 1 month"
       ExpiresByType image/png "access plus 1 month"
       ExpiresByType image/jpg "access plus 1 month"
       ExpiresByType image/jpeg "access plus 1 month"
       # CSS
       ExpiresByType text/css "access plus 1 month"
       # Javascript
       ExpiresByType application/javascript "access plus 30 minutes"
       </IfModule>
       ```
   
 * This code will cache the assets for around 30 days. Except for the javascript
   which should only be cached for 30 minutes.
 * Hopefully Google Pagespeed likes this.
 *  [MarkRH](https://wordpress.org/support/users/markrh/)
 * (@markrh)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/leverage-browser-caching-30/#post-7006353)
 * You can’t control what 3rd party sites do, such as the stuff at maps.google.com.
   You can only affect what your blog’s own webserver sends to the client.
 * It’s possible that Google does not set that specific script to be cached on purpose.
 *  [Reagan Lynch](https://wordpress.org/support/users/rdlynch/)
 * (@rdlynch)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/leverage-browser-caching-30/#post-7006370)
 * [@markrh](https://wordpress.org/support/users/markrh/) thanks for catching that
   I didn’t even notice that it was a Google Maps link.
 * it does raise the question as to why Google Pagespeed even flags its own sites.
   I guess if nothing else you can get the information on what is causing slow page
   load times.
 *  Thread Starter [rainman50](https://wordpress.org/support/users/rainman50/)
 * (@rainman50)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/leverage-browser-caching-30/#post-7006449)
 * Thanks for the replies. I’ll post an update with new info.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Leverage browser caching’ is closed to new replies.

## Tags

 * [20q2016](https://wordpress.org/support/topic-tag/20q2016/)
 * [browser caching](https://wordpress.org/support/topic-tag/browser-caching/)
 * [pagespeed](https://wordpress.org/support/topic-tag/pagespeed/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [rainman50](https://wordpress.org/support/users/rainman50/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/leverage-browser-caching-30/#post-7006449)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
