Closed Bug 1205332 Opened 9 years ago Closed 7 years ago

investigate how service workers interact with bfcache

Categories

(Core :: DOM: Service Workers, defect)

32 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bkelly, Unassigned)

References

Details

Anne raises some questions about how service workers will interact with bfcache here:

  http://logs.glob.uno/?c=content#c322157

For example,

1) Should the service worker still see FetchEvents for documents when you go back when the document is in the bfcache?  Might surprise devs.
2) Can a document in the bfcache keep the ServiceWorker from updating to a new version because its still controlling a document.

And other such behavior.

I think this is a bit corner casey and probably needs real-world dev input, so setting as v3.
(In reply to Ben Kelly [:bkelly] from comment #0)
> 1) Should the service worker still see FetchEvents for documents when you go
> back when the document is in the bfcache?  Might surprise devs.

I would say no, as there is no network request happening.

> 2) Can a document in the bfcache keep the ServiceWorker from updating to a
> new version because its still controlling a document.

I believe so, since we have nothing to prevent that from happening AFAIK.

But a page that cares about this can register a beforeunload handler and disable bf-cache.

> I think this is a bit corner casey and probably needs real-world dev input,
> so setting as v3.

Well, issue #1 is not a bug.  And I don't think we'd want to disable bf-cache for all controlled documents, so it's not clear to me if we'd want to fix #2 either, but at any rate, it's fine to punt on this for now.
We've discussed this at spec meetings before.  I believe the answers are:

> 1) Should the service worker still see FetchEvents for documents when you go
> back when the document is in the bfcache?  Might surprise devs.

No.

> 2) Can a document in the bfcache keep the ServiceWorker from updating to a
> new version because its still controlling a document.

No.

We have discussed adding a "client controlled" event that the SW would see for a document coming out of bfcache, though.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.