{"id":480,"date":"2011-12-25T21:40:06","date_gmt":"2011-12-25T21:40:06","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=480"},"modified":"2011-12-25T21:40:06","modified_gmt":"2011-12-25T21:40:06","slug":"page-speed-google-hosted-javascript-libraries","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/page-speed-google-hosted-javascript-libraries\/","title":{"rendered":"Page speed is calling out Google hosted Javascript libraries"},"content":{"rendered":"<p>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 <em>max-age<\/em> of the script isn&#39;t quite long enough.<\/p>\n<p>Well, what can you do? It&#39;s hosted by a third party. Actually, Google had this in mind when they designed their library hosting service.<\/p>\n<p>If you are accessing a a major or minor release, Google will actually update all &quot;minor-minor&quot; releases automatically.<\/p>\n<p>For instance, if you call<\/p>\n<p>http:\/\/ajax.googleapis.com\/ajax\/libs\/jqueryui\/1.8\/themes\/smoothness\/jquery-ui.css<\/p>\n<p>Google will return the most current release within the 1.8 minor release, 1.8.16 for example. While this is awesome, it doesn&#39;t allow us to leverage long-term HTTP caching, as a new release wouldn&#39;t be updated. Hence, Google will only cache it with a <em>max-age<\/em> of 1 hour.<\/p>\n<p>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&#39;ll find that Google has set the <em>max-age<\/em> parameter to 1 year! Page speed likes this. i.e.<\/p>\n<p>http:\/\/ajax.googleapis.com\/ajax\/libs\/jqueryui\/1.8.16\/themes\/smoothness\/jquery-ui.css<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[41],"tags":[110,151],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/480"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=480"}],"version-history":[{"count":1,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/480\/revisions"}],"predecessor-version":[{"id":481,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/480\/revisions\/481"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}