Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

early design review: bfcache/prerendering eviction APIs #786

Closed
fergald opened this issue Nov 18, 2022 · 4 comments
Closed

early design review: bfcache/prerendering eviction APIs #786

fergald opened this issue Nov 18, 2022 · 4 comments
Assignees
Labels
Progress: review complete Resolution: satisfied with concerns The TAG is satisfied with this work overall but requires changes Review type: CG early review An early review of general direction from a Community Group Topic: BFCache

Comments

@fergald
Copy link

fergald commented Nov 18, 2022

Wotcher TAG!

I'm requesting a TAG review of to invalidate documents in BFCache or prerendering when cookies or storage keys change.

We propose to add an API that allows a document to declare that it must be invalidated (evicted from BFCache or prerendering cancelled) if certain cookies or storage keys change while it is in inactive.

For example, the following JS snippet will cause any documents from this document’s origin which are currently inactive to be invalidated if the ‘SID’ cookie changes,

inactiveDocumentController.invalidationSignals.cookies = ['SID'];

Similarly, the following JS snippet will cause any documents from this document’s origin which are currently inactive to be invalidated if the value of the key ‘authToken’ in session storage changes,

inactiveDocumentController.invalidationSignals.sessionStorage = ['authToken'];

Further details:

You should also know that...

This the first step of a plan to allow pages with Cache-Control: no-store into BFCache.

We'd prefer the TAG provide feedback as (please delete all but the desired option):

☂️ open a single issue in our GitHub repo for the entire review

¹ For background, see our explanation of how to write a good explainer. We recommend the explainer to be in Markdown.

² Even for early-stage ideas, a Security and Privacy questionnaire helps us understand potential security and privacy issues and mitigations for your design, and can save us asking redundant questions. See https://www.w3.org/TR/security-privacy-questionnaire/.

@fergald fergald added Progress: untriaged Review type: CG early review An early review of general direction from a Community Group labels Nov 18, 2022
@torgo torgo added this to the 2023-01-09-week milestone Jan 4, 2023
@fergald
Copy link
Author

fergald commented Apr 20, 2023

FYI, chrome is close to origin trial of the cookie-related parts of this along with unblock BFCache entry for pages with Cache-Control: no-store. The storage-related parts need some revision and add a lot more compexity, so are shelved for the time-being.

@torgo
Copy link
Member

torgo commented Jul 3, 2023

Hi @fergald is there any information on multi-stakeholder support? Also do you have any info you can share from any experimentation with developers? Have you explored the non js-centric solution any further?

@torgo torgo removed this from the 2023-07-03-week milestone Jul 16, 2023
@torgo torgo added this to the 2023-07-31-f2f-Mos-Eisley milestone Jul 16, 2023
@cynthia
Copy link
Member

cynthia commented Jul 31, 2023

We've discussed and looked at this during our vF2F. The API surface/design, use cases this attempts to solve seem valid - and is articulated through a well-written explainer.

The part that we are concerned about this proposal is more philosophical - the question that remains to be asked is whether exposing cache control going to work this time. If it doesn't this will potentially end up with a widely-used antipattern which eventually makes everyone's life difficult. This has happened in the past, and given how cache is a complex problem - there is a non-zero chance this will happen in the future. If the risks of (unintentional, e.g. "preventing cache on everything fixes a simple problem I have!" pattern for example.) misuse is higher than the gains of exposing this, then maybe this shouldn't be exposed.

@cynthia
Copy link
Member

cynthia commented Jan 17, 2024

We think the use cases are valid, but still have some concerns around potential misuse patterns as we mentioned above. Closing with concerns as we haven't heard back and we don't think small delta changes in the API as it stands likely will change that.

@cynthia cynthia closed this as completed Jan 17, 2024
@cynthia cynthia reopened this Jan 23, 2024
@cynthia cynthia closed this as completed Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Progress: review complete Resolution: satisfied with concerns The TAG is satisfied with this work overall but requires changes Review type: CG early review An early review of general direction from a Community Group Topic: BFCache
Projects
None yet
Development

No branches or pull requests

6 participants