{"id":228,"date":"2011-10-29T13:28:08","date_gmt":"2011-10-29T18:28:08","guid":{"rendered":"http:\/\/cbateman.com\/blog\/?p=228"},"modified":"2012-05-09T22:03:26","modified_gmt":"2012-05-10T04:03:26","slug":"application-cache-doesnt-fool-around","status":"publish","type":"post","link":"https:\/\/cbateman.com\/blog\/application-cache-doesnt-fool-around\/","title":{"rendered":"Application Cache Doesn&#8217;t Fool Around"},"content":{"rendered":"<p>If you&#8217;re actively developing a site that&#8217;s going to use the HTML5 application cache &#8211; don&#8217;t actually add it until you&#8217;re ready to go. Because once the browser gets a hold of it, you have to edit the manifest file every time you make any change to a file referenced in it.<\/p>\r\n\r\n<p>It&#8217;s not like regular file caching, where a hard refresh can get a new version of everything. Once you cache something in the manifest, you&#8217;re stuck with it until you update the manifest file. And even then, the browser checks for updates to the manifest after it&#8217;s already displayed what it has &#8211; so you have to refresh a second time to see the changes (that&#8217;s why some sites will pop up a message to let you know there&#8217;s a new version available).<\/p>\r\n\r\n<p>So what if you&#8217;ve already added a manifest, and you want to get rid of it?\u00a0If you simply remove the manifest link from your HTML, you won&#8217;t make much progress, because guess what?\u00a0The page that references the manifest is always cached. So the browser won&#8217;t know that you&#8217;ve removed the manifest file. The trick is to delete or rename the manifest file, causing it to 404. With a missing manifest, the browser will clear everything out and you&#8217;re good to go again.<\/p>\r\n\r\n<hr \/>\r\n\r\n<p>By the way, here&#8217;s a handy tip: in Google Chrome, you can see exactly what is currently cached by typing &#8220;about:appcache-internals&#8221; in the address bar.<\/p>\r\n\r\n<p><strong>Update:<\/strong> To work on iOS, you must name the manifest &#8220;cache.manifest.&#8221; Don&#8217;t ask me why.<\/p>","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re actively developing a site that&#8217;s going to use the HTML5 application cache &#8211; don&#8217;t actually add it until you&#8217;re ready to go. Because once the browser gets a hold of it, you have to edit the manifest file every time you make any change to a file referenced in it. It&#8217;s not like regular file caching, where a&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-228","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/posts\/228"}],"collection":[{"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/comments?post=228"}],"version-history":[{"count":10,"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/posts\/228\/revisions"}],"predecessor-version":[{"id":595,"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/posts\/228\/revisions\/595"}],"wp:attachment":[{"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/media?parent=228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/categories?post=228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cbateman.com\/blog\/wp-json\/wp\/v2\/tags?post=228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}