Intent to Prototype + PSA: making Back/Forward Cache work despite Cache-control: no-store

132 views
Skip to first unread message

Kenji Baheux

unread,
Feb 16, 2022, 9:57:48 PM2/16/22
to bfcac...@chromium.org, fer...@chromium.org, deno...@chromium.org

bcc: blink-dev, chromium-dev


Hi,


Contact emails

kenji...@chromium.org, fer...@chromium.org, deno...@chromium.org


Specification


We would like to share our current plan to make Back/Forward Cache (BFCache) work despite the presence of Cache-control: no-store (CCNS) HTTP headers. Please, have a look, share around, and let us know if there is room for improvements or big concerns.


Context


  • The CCNS HTTP header is designed to prevent HTTP caches from storing a response. 

  • While this wasn’t required by any specification*, all implementations of BFCache are currently ignoring pages with CCNS. This means that many back/forward navigations are much slower than necessary.

  • Since BFCache has long been a thing, many websites have built a dependency on the unintended interaction between CCNS and BFCaches. In particular, CCNS is used on pages potentially containing personalized details (i.e. logged in state). The expectation vis-a-vis BFCache & CCNS is that if a user logs out from the website, then the previously visited pages can’t be restored when another user hits the back button.


*: Strictly speaking, the specification for the Cache-Control header doesn’t apply to BFCaches, because those are not HTTP caches.


Goals

We would like to:

  1. Improve back/forward navigations for websites using CCNS...

  2. ... while preventing any significant surprises, and...

  3. offer better guidance for the future, with the benefit of hindsight.


Tentative timeline

  1. Heads-up (this announcement) + call for feedback + adjustments if needed.

  2. M100+ (Chrome Canary): work-in-progress implementation behind a command line (see the hands-on section); partners checks.

  3. TBD: Trial run (monitor metrics & feedback from community).

  4. TBD: Launch or adjust + try again.


In a nutshell (see this doc for all the details)

Our tentative proposal consists of storing CCNS pages in BFCache with the behaviors and carve-outs detailed below. 


Note that this is subject to changes, based on feedback from the community, and learnings from experimentation. We also intend to work with other browser vendors and standard bodies on refining & specifying these behaviors, and carve-outs.


Behaviors

  • Evict same-site pages when any HTTP-only cookie changes.

  • Evict same-site pages when the HTTP header Clear-Site-Data includes any of the following values: "cache", “executionContexts”, “*” (to be confirmed with spec editors).

  • Evict pages if their HTTP-Authentication state changes.


Carve-outs:

In any of the following conditions, CCNS pages will NOT be stored in BFCache:

  • When the user has disabled JavaScript.

  • When the CCNS  page has no HTTP-only cookies. Note: this also covers the cases in which the user has disabled cookies.

  • When the behavior is disabled by the administrator of an enterprise/education deployment, via a dedicated group policy. Note: to minimize surprises, the group policy will default to disabling this new behavior, if any other group policy is set (i.e. requiring no action to preserve the status quo). This defaulting behavior may change in the future depending on what we will learn about these managed environments.


Let us know if you are aware of any significant scenarios that we missed, or for which the proposed plan would create new problems:

  • Reply to this thread with your  feedback.

  • Or start a new thread on bfcac...@chromium.org with [CCNS] in the subject line


Hands-on

An experimental version can be enabled via the command line option below:

  • --enable-features=CacheControlNoStoreEnterBackForwardCache:level/restore-unless-http-only-cookie-change


Note: this is a work-in-progress implementation, and some secondary aspects are currently missing. Notably, the Clear-Site-Data behavior is not implemented yet.


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

No support on WebView planned at the moment.


Is this feature fully tested by web-platform-tests?

No.


Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1228611


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/6705326844805120


Reply all
Reply to author
Forward
0 new messages