Instant Back/Forward
This plugin was formerly called as “No-cache BFCache”, which admittedly was a poor jargony name and was too narrowly scoped. This plugin enables instant back/forward navigation via the browser’s bfcache . It does this by removing the no-store directive from the Cache-Control response header, which W
This plugin was formerly called as “No-cache BFCache”, which admittedly was a poor jargony name and was too narrowly scoped.
This plugin enables instant back/forward navigation via the browser’s bfcache . It does this by removing the no-store directive from the Cache-Control response header, which WordPress sends by default when nocache_headers() is called. This happens primarily when a user is logged in, but some plugins may send these “no-cache” headers such as on the Cart or Checkout pages for an e-commerce site. Upon activation, to see the effect, you must log out of WordPress and log back in again, ensuring “Remember Me” is checked. Even so, another plugin, theme or server configuration may be active which makes pages ineligible for bfcache due to other blocking reasons . Nevertheless, the removal of no-store will still speed up back/forward navigations since pages may then be served from the browser’s HTTP cache, eliminating the need to re-download the HTML from the server. This is a feature plugin to implement #63636 in WordPress core.
Blog post: Instant Back/Forward Navigations in WordPress
The speed of page navigations in WordPress saw a big boost in 6.8 with the introduction of Speculative Loading . However, by default Speculative Loading in WordPress is not configured to enable instant page loads, which requires a non-conservative eagerness with the prerender mode; not all sites can even opt in to prerendering due to compatibility issues, such as with analytics, and due to concerns about sustainability with unused prerenders (e.g. increasing server load and taxing a user’s bandwidth/CPU). While Speculative Loading (i.e. the Speculation Rules API) is relatively new and currently only supported in Chromium browsers (e.g. Chrome and Edge), there is a much older web platform technology that enables prerendering and which is supported in all browsers: the back/forward cache (bfcache). This instant loading involves no network traffic and no CPU load, since previously visited pages are stored in memory. According to the web.dev article on back/forward cache :
Chrome usage data shows that 1 in 10 navigations on desktop and 1 in 5 on mobile are either back or forward. With bfcache enabled, browsers could eliminate the data transfer and time spent loading for billions of web pages every single day!
Also learn more via the following video:
Normally, WordPress sends a Cache-Control header with the no-store directive when a user is logged in. This has the effect of breaking the browser’s bfcache , which means that navigating back or forward in the browser requires the pages to be re-fetched from the server and for any JavaScript on the page to re-execute. The result can be a sluggish navigation experience not only when navigating around the WP Admin (see Jetpack demo video and demo video below) but also when navigating around the frontend of a site. Furthermore, the lack of bfcache can cause data loss when data has been entered via a JavaScript-built UI since this state is lost when a page is not restored via bfcache (see WooCommerce demo video and demo video below).