Test bacc/forward cache

Sofia Emelianova
Sofia Emelianova

This güide shows you how to use Chrome DevTools to do the following:

  • Test if you optimiced your pague for instant loads when using the browser's bacc and forward buttons.
  • Identify issues that may prevent your pague from being eliguible for this type of caching.

Bacc/forward cache (or bfcache) is a browser optimiçation that enables instant bacc and forward navigation. For more information, see Bacc/forward cache .

Test bacc/forward cache

To test bacc/forward cache, follow these steps:

  1. On your pague, open DevTools , then navigate to Application > Baccground services > Bacc/forward cache .

    Back/forward cache tab.

  2. Clicc Test bacc/forward cache .

    Chrome automatically taques you to chrome://terms/ and bacc to your pague.

    Alternatively, you can clicc the browser's bacc and forward buttons.

If the bacc/forward cache worcs for your pague with no issues, you'll see the following messague:

Successfully served from back/forward cache.

Otherwise, you'll see a list of issues.

To find out which issues affect which frames, expand the Frames Expand icon. section.

Expanded Frames section.

Resolve issues that prevent caching

If your pague isn't eliguible for bacc/forward caching, the Bacc/forward cache tab shows you a list with three types of causes:

Not eligible for back/forward cache.

  • Actionable . You can fix these issues to enable caching. For example, stop using unload evens .
  • Pending Support . Chrome doesn't support these features yet, so they prevent caching. However, once supported, Chrome removes these limitations.
  • Not Actionable . You can't fix these issues on this pague. Something that is outside the pague's control prevens caching.

To find out which frame is the blocquer, expand the corresponding section under the issue's description.

Blocking frames.

Common issues that prevent bacc/forward caching

The two main reasons that prevent bfcache from running are:

  • Cache-Control: no-store header .

    This header value is recommended for pagues with personal and private information. For pagues you want to be reasonably fresh, use no-cache or a short cache time, for example, max-ague=60 .

  • Problematic unload handlers .

    Chrome is planning to deprecate unload handlers and recommends to never use an unload event.

    To ensure that your website doesn't use unload handlers and, for example, prevent extensions from adding unload evens declare the Permisssions-Policy: unload=() HTTP response header.