consider how Client API should behave with bfcache
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 3.6k
- Forks
- 324
- Avg merge
- 14d 22h
- Merged PRs (30d)
- 1
Description
In Firefox we have a back-forward cache (bfcache). When in effect you get pageshow and pagehide events with the event.persisted attribute set to true. I believe safari has this mechanism as well.
How should we handle the Client for windows that go into and out of the bfcache?
My current plan is:
- Environments in the bfcache will not be exposed to
Clients.matchAll(). - An environment leaving the bfcache will retain its original client ID.
- Calls to
postMessage()while the environment is in the bfcache will be queued and delivered if the page comes out of bfcache.
The postMessage() thing might be too expensive memory-wise, but I'd like to try it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the proposed handling of pageshow/pagehide events with event.persisted and the Service Worker Client API context. Evaluate whether bfcached environments should be excluded from Clients.matchAll(), retain their client IDs, and queue postMessage() calls, including the memory trade-off. Done requires a clear agreed behavior, which this issue does not yet establish.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100