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

Back/Forward Cache #628

Closed
1 task done
rakina opened this issue Apr 30, 2021 · 5 comments
Closed
1 task done

Back/Forward Cache #628

rakina opened this issue Apr 30, 2021 · 5 comments
Assignees

Comments

@rakina
Copy link

rakina commented Apr 30, 2021

Hi TAG!

I'm requesting a TAG review of Back/Forward Cache (BFCache).

We’ve recently looked into how BFCache is specified in the HTML spec and other standards, and noticed some problems with the current state. We’ve identified possible solutions for some of them, but we’re interested in getting TAG’s opinion on how we should approach these problems, especially the ones we don’t really have answers to.

The explainer can be found here. TL;DR:

  • How various APIs/existing concepts interact with BFCache is quite underspecified
  • How BFCache is specified is quite subtle, so it’s hard for API spec authors to specify things correctly
  • User agent implementation varies quite a lot
  • We have concrete proposal to update various docs (Web Platform Design Principles and Security and Privacy Questionnaire) and improve the foundational HTML spec, but there are open questions on more high-level stuff such as “How should we retrofit current APIs” and “Which behavior should be specified and which should be left to user agents’ discretion?”

This is probably different from the usual TAG review request, as we’re not really asking for a review of specific APIs, but instead want to answer more meta questions around the design process and how we should approach specifying things (as mentioned above). Our goal is to improve currently-existing specifications and also ensure new APIs are designed with BFCache support in mind by integrating it into the existing design guidelines (and hopefully TAG reviews can help enforce this).

Further details:

  • I have reviewed the TAG's Web Platform Design Principles
  • Relevant time constraints or deadlines: We're hoping to update TAG docs etc sometime in the next 1-2 months
  • The group where the work on this specification is currently being done: WHATWG
  • The group where standardization of this work is intended to be done (if current group is a community group or other incubation venue): WHATWG
  • Major unresolved issues with or opposition to this specification: (see explainer)
  • This work is being funded by: Google

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

💬 leave review feedback as a comment in this issue and @-notify @rakina

@hober
Copy link
Contributor

hober commented May 11, 2021

Hi @rakina! I took a look at this during a breakout at our F2F this week.

We’ve recently looked into how BFCache is specified in the HTML spec and other standards, and noticed some problems with the current state. We’ve identified possible solutions for some of them[…]

Thanks for bringing this to our attention! This is really great work.

We (the TAG) would be super happy to review & merge any PRs you'd like to send our way to improve these documents.

but there are open questions on more high-level stuff such as “How should we retrofit current APIs”

I think you're right that there's sometimes a tension when retrofitting between compat and the reasonable desire to have as many pages eligible for the bfcache as possible. I don't think there's an overall answer—gaguing the severity of a compat hit is ultimately an empirical question, as is the question of how many page's eligibility is negatively affected. You need to take things on a case-by-case basis. And it's clear from your explainer that you understand the tradeoffs.

“Which behavior should be specified and which should be left to user agents’ discretion?”

I think this is ultimately pragmatic. All things being equal, it's better to fully specify things, but there are legitimate reasons for User Agents' policies to differ from one another. The best way to determine if a feature's behavior can be specified or left to user agents' discretion is to ask the engineers who work on that feature in each user agent. How feasible would it be for them to change their behavior to match the desired behavior? If it wouldn't be feasible, is there a way to partially specify things, to narrow the interop gap without entirely closing it? What can everyone live with?

Our goal is to improve currently-existing specifications and also ensure new APIs are designed with BFCache support in mind by integrating it into the existing design guidelines (and hopefully TAG reviews can help enforce this).

This is a great goal and I hope you succeed.

rakina added a commit to rakina/design-principles that referenced this issue May 19, 2021
As discussed in w3ctag/design-reviews#628, we want to improve support for BFCache/non-fully active documents, as we noticed that a lot of API specifications do not handle it well/explicitly.

This change adds various guides and things to be aware of related to non-"fully active" documents, including gives various examples. We hope this will help future APIs to handle BFCache/on-"fully active" documents correctly by default.
rakina added a commit to rakina/design-principles that referenced this issue May 19, 2021
As discussed in w3ctag/design-reviews#628, we want to improve support for BFCache/non-fully active documents, as we noticed that a lot of API specifications do not handle it well/explicitly.

This change adds various guides and things to be aware of related to non-"fully active" documents, including gives various examples. We hope this will help future APIs to handle BFCache/on-"fully active" documents correctly by default.
@rakina
Copy link
Author

rakina commented May 19, 2021

Thanks @hober! We’ve sent PRs to update the documents (1, 2) and will open more spec issues for BFCache, tracked in the BFCache meta-bug.

We will also continue working with owners of current APIs (and start contacting ones we haven’t reached out to yet) to figure out how BFCache fits into their API. We’re grateful that TAG supports our goal, and we hope TAG can help by checking for the "bfcache consideration" bit for future APIs in TAG reviews!

Thanks again!

@torgo torgo added the Progress: propose closing we think it should be closed but are waiting on some feedback or consensus label Aug 26, 2021
hober pushed a commit to w3ctag/design-principles that referenced this issue Sep 14, 2021
* Add non-"fully active" document handling guide

As discussed in w3ctag/design-reviews#628, we want to improve support for BFCache/non-fully active documents, as we noticed that a lot of API specifications do not handle it well/explicitly.

This change adds various guides and things to be aware of related to non-"fully active" documents, including gives various examples. We hope this will help future APIs to handle BFCache/on-"fully active" documents correctly by default.

* Rewrite "discard" bit

* Apply suggestions from code review

Co-authored-by: Domenic Denicola <d@domenic.me>

* Apply suggestions from review

* Link to pattern

* Add note about prerender

* Link to discard definition

* Link to Geolocation API's TR page.

* Apply suggestions from code review

Co-authored-by: Marcos Cáceres <marcos@marcosc.com>

* Do not leave document stale

* prerender link

* Use old link for prerender

Co-authored-by: Domenic Denicola <d@domenic.me>
Co-authored-by: Marcos Cáceres <marcos@marcosc.com>
hober pushed a commit to w3ctag/security-questionnaire that referenced this issue Sep 14, 2021
* Add non-"fully active" document question

As discussed in w3ctag/design-reviews#628, there are some privacy considerations that might be worth pointing out in the Security & Privacy Questionnaire.

This change adds a question on non-"fully active" document handling to the questionnaire.

* Quotes & remove bikeshed syntax

* Address comments
@torgo torgo added Venue: WHATWG and removed Progress: propose closing we think it should be closed but are waiting on some feedback or consensus labels Sep 21, 2021
@cynthia cynthia added Progress: review complete Resolution: satisfied The TAG is satisfied with this design and removed Progress: in progress labels Dec 6, 2021
@cynthia
Copy link
Member

cynthia commented Dec 6, 2021

Closing! (this should have been closed with the last comment, but something happened.)

@cynthia cynthia closed this as completed Dec 6, 2021
@rakina
Copy link
Author

rakina commented Aug 25, 2022

Hello! During last month's F2F, Chrome's BFCache team met with TAG and discussed how we can improve BFCache-support checking during TAG reviews, as we have noticed some APIs had gone through TAG review but don't support BFCache.

One thing we decided to do is to rewrite the Design Principles guide and Security & Privacy Questionnaire question to be simpler and more explicit, and move the full BFCache guide into a separate document, like the Promise Guide. I've finished rewriting the guide (with lots of input from @domenic, @fergald, and @cynthia) and can be found here:

We're hoping the TAG will reopen this issue to review the rewritten docs (cc @hober and @torgo). We also realized that the docs didn't get reviewed by other browser vendors last time, so tagging @smaug---- and @cdumez (or other BFCache folks from Mozilla/Apple) to review the new documents.

Other ideas that came up during the TAG F2F was:

  • Adding an explicit "BFCache considerations" section to specs, which @domenic is trying out with some new specs we're working on, we'll see if we can get that be a required section for new specs.
  • Improvements to the TAG design review process to be more consistent and follow the latest guidelines. I don't really have much visibility into this, but looking forward to seeing the improvements!

@rakina
Copy link
Author

rakina commented Sep 29, 2022

Friendly ping for reviews :) (should this issue be re-opened?) cc @cynthia @hober @torgo

hober pushed a commit to w3ctag/design-principles that referenced this issue Apr 20, 2023
* Add non-"fully active" document handling guide

As discussed in w3ctag/design-reviews#628, we want to improve support for BFCache/non-fully active documents, as we noticed that a lot of API specifications do not handle it well/explicitly.

This change adds various guides and things to be aware of related to non-"fully active" documents, including gives various examples. We hope this will help future APIs to handle BFCache/on-"fully active" documents correctly by default.

* Rewrite "discard" bit

* Apply suggestions from code review

Co-authored-by: Domenic Denicola <d@domenic.me>

* Apply suggestions from review

* Link to pattern

* Add note about prerender

* Link to discard definition

* Link to Geolocation API's TR page.

* Apply suggestions from code review

Co-authored-by: Marcos Cáceres <marcos@marcosc.com>

* Do not leave document stale

* prerender link

* Use old link for prerender

Co-authored-by: Domenic Denicola <d@domenic.me>
Co-authored-by: Marcos Cáceres <marcos@marcosc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants