You may have done everything you can to optimize the JavaScript resources that you host on your server, but if you find yourself using a Google hosted JavaScript library, Page Speed might be complaining that the max-age of the script isn't quite long enough.

Well, what can you do? It's hosted by a third party. Actually, Google had this in mind when they designed their library hosting service.

If you are accessing a a major or minor release, Google will actually update all "minor-minor" releases automatically.

For instance, if you call

Google will return the most current release within the 1.8 minor release, 1.8.16 for example. While this is awesome, it doesn't allow us to leverage long-term HTTP caching, as a new release wouldn't be updated. Hence, Google will only cache it with a max-age of 1 hour.

But, if you are confident and secure with the exact version of a library you are using, simply include the full version number, and you'll find that Google has set the max-age parameter to 1 year! Page speed likes this. i.e.


Leave a Reply

Your email address will not be published. Required fields are marked *