{"id":216,"date":"2022-05-16T23:09:42","date_gmt":"2022-05-16T21:09:42","guid":{"rendered":"https:\/\/blue-marketing.pl\/\/?p=216"},"modified":"2022-05-16T23:09:43","modified_gmt":"2022-05-16T21:09:43","slug":"why-is-the-back-forward-cache-so-much-faster","status":"publish","type":"post","link":"https:\/\/blue-marketing.pl\/en\/uncategorized\/216\/","title":{"rendered":"Why Is The Back\/Forward Cache So Much Faster?"},"content":{"rendered":"\n<p>Browser makers have to make sure it\u2019s safe to just restore pages like this, and the problem is many sites are not written with the expectation that a page can be restored like this and think (not entirely unreasonably!) that when the page is navigated away from that the user isn\u2019t coming back without a full page reload.<\/p>\n\n\n\n<p>For example, some pages may register an&nbsp;<code>unload event listener<\/code>&nbsp;in JavaScript to perform some clean-up tasks under the assumption the user is finished with this page. That doesn\u2019t work well if the page is then restored from the Back\/Forward Cache. Now, to be honest, the&nbsp;<code>unload event listener<\/code>&nbsp;has been seen as a bad practice for a while now as it is not reliably fired (e.g. if the browser crashes, or the browser is backgrounded on a mobile and then killed), but the Back\/Forward cache gives a more pressing reason why it should be avoided because browsers will not use the Back\/Forward Cache if your page or any of its resources uses an&nbsp;<code>unload event listener<\/code>.<\/p>\n\n\n\n<p>There are a number of other reasons why your page might not be eligible for the Back\/Forward cache. Counterintuitively, for a web performance feature, some of these reasons are due to other web performance features:<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Browser makers have to make sure it\u2019s safe to just restore pages like this, and the problem is many sites are not [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":181,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-216","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"acf":[],"_links":{"self":[{"href":"https:\/\/blue-marketing.pl\/en\/wp-json\/wp\/v2\/posts\/216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blue-marketing.pl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blue-marketing.pl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blue-marketing.pl\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blue-marketing.pl\/en\/wp-json\/wp\/v2\/comments?post=216"}],"version-history":[{"count":1,"href":"https:\/\/blue-marketing.pl\/en\/wp-json\/wp\/v2\/posts\/216\/revisions"}],"predecessor-version":[{"id":220,"href":"https:\/\/blue-marketing.pl\/en\/wp-json\/wp\/v2\/posts\/216\/revisions\/220"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blue-marketing.pl\/en\/wp-json\/wp\/v2\/media\/181"}],"wp:attachment":[{"href":"https:\/\/blue-marketing.pl\/en\/wp-json\/wp\/v2\/media?parent=216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blue-marketing.pl\/en\/wp-json\/wp\/v2\/categories?post=216"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blue-marketing.pl\/en\/wp-json\/wp\/v2\/tags?post=216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}