WordPress.org

Support

Support » How-To and Troubleshooting » Leverage Browser Caching question

Leverage Browser Caching question

  • google speed test tell me to Leverage Browser Caching .
    I understand this is for images, css, java and that the expiry dates should be set up to a year.
    Say that I need to edit my css files or change an image, what’s gonna happened if I have the Leverage Browser Caching set up? Nobody will be able to see the changes after the expiry dates?
    sorry if this is a dumb question but Im new to WP

Viewing 13 replies - 1 through 13 (of 13 total)
  • Jerry Bates (jerrysarcastic)

    @jerrysarcastic

    Documentation Master

    You should definitely use a caching plugin; most WordPress sites benefit from caching, except for a few special cases. We use this one on client sites all the time, and it is very well respected.
    W3 Total Cache

    You can also search the word “cache” in the plugins directory (Plugins>Add New) as there are several others as well.

    No. Browser caching is not the same as server caching. What this tells a browser is that this file is good to load from a local browser cache for or until x time unless the file has changed on the server (when done right). Disregard as long as you have allowed browser caching of some form as when not that means each time a visitor returns, loads multiple pages or posts each part of site has to be sent to the browser. This is an important site performance item. Your web assets should have time tags that the browser compares, which means any site (static file) changes then get the 200 OK for dynamic content, 200 OK for modified content, and 304 which is ‘load from local cache’ for not modified static content. Note many wordpress sites load poorly due this being done wrong or having too much dynamic content per page. The WordPress “loop” is dynamic, but much of many sites is static especially external css and js files, header images, sidebar content, footer content etc.

    Jerry Bates (jerrysarcastic)

    @jerrysarcastic

    Documentation Master

    By the way, this is not the same as leveraging browser caching, but the above mentioned plugin should help improve your score considerably.

    Jerry Bates (jerrysarcastic)

    @jerrysarcastic

    Documentation Master

    Yes, I understand that, and know the difference; even “static” pages require database calls in the absence of server-side cacheing. A good WP caching plugin improves your site performance overall.

    If you’re comfortable editing .htaccess yourself, you can add your own expires to leverage browser caching. Here’s a good primer on the subject: http://thomasgriffinmedia.com/blog/2010/11/how-to-leverage-browser-caching-in-wordpress-via-htaccess/

    I was sending my reply to the OP (and not you) and coincidentally as you made your post.

    I’m already using a caching plugin, Quick Cache.
    Thanks JerrySarcastic, I saw your link, thanks

    SwansonPhotos, you are saying that it doesn’t matter the length of the expiry date I set on the htacces file , if I update a picture or a css file, the browser will show the updated file, right?

    It will unless you are using a server caching plugin that for example serves cached html pages…it’s a trade off, server performance, visitor browser load times, content update schedule…

    Most caching plugins let you clear the cache and additionally set some options for what is cached and for how long it is cached. Again, these are set based on site cotent, web server performance, # of hits on site, content update interval….etc..

    Jerry Bates (jerrysarcastic)

    @jerrysarcastic

    Documentation Master

    Sorry SwansonPhotos… your favicons looked so similar I thought I was speaking to the same person. Keep on rocking! 🙂

    LOL, I love my Gravatar!

    Jerry Bates (jerrysarcastic)

    @jerrysarcastic

    Documentation Master

    Lol I meant Gravatar… damned Mondays.

    I have the expiration time on Quick Cache files to 3600 seconds… I don’t know if this wold interfere with the Leverage browser settings

    It means that plugin will cache content for serving to a browser for that time period…and the best way to test all this is to go back use the tools you started with…follow up with the documentation links, review in the appropriate forums and ask for advice from webhost or others on this.

    If you don’t use W3 Total Cache plugin, the best way to enable the browser caching is to edit .htaccess. Check an example at http://howtounix.info/howto/How-to-Leverage-browser-caching. It also explains how to disable ETags (YSlow doesn’t like them).

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Leverage Browser Caching question’ is closed to new replies.