Ive just run a google page speed test on my site and one of the things its suggested to do is use browser caching. I already do you browser caching for most large images and other assets that in frequently change, but its also suggesting i add browser cacheing for :
- UI .png images
- Minified CSS
- Minified JS
- Google analytics JS tag from Google CDN (currently 2 hours cache)
- 3rd party JS tracking tag from 3rd party CDN (currently 4 hours cache)
On the last 2 which are hosted by 3rd parties so i cant set the cache settings.
On the first 3 bullet points, i dont really want to set them to be cached as if for instance there was a change to the navigation of the website the HTML, CSS, JS, and UI graphics would all need to be updated, if a user had some of that cached, it could mean that they where served HTML which was not in sync with the cached JS, CSS, UI pngs.
Is there a way to get around this by be able to set something browser or server side that would allow me to cache the JS, CSS, UI pngs, but if / when i make a change and they need to be updated i could put up a notice that lets all visitors browsers know to re download all the assets and not use their previous cache ?
In case its asked : Server wise the site is running Apache.