Re: [w3c/ServiceWorker] Making a concurrent request for navigations (#920)

I think that being able to add a custom header is preferable to cookies. To sum up my argument for a custom header.

- As @asutherland said, cookies will work most of the time but they can be very unreliable. Different browsers have different limits for cookies and will do different things when they hit such limits. I think that the cookie solution will introduce a number of edge cases for when cookies are missing that will need to be dealt with. We'll be able to figure this out, but for smaller developers I think this will introduce a bit of unnecessary overhead and make doing complex things with joining cache and response streams in service workers much harder. Ultimately I think that there's somewhat of a tradeoff here between a bit of extra work for vendors and work for web developers.

- Cookies get sent always but much of this data is only relevant for service workers. Sending the cookies on every page is a waste and also due to the various browser cookie limits it may mean that we end up hitting such limits faster.

- Even in @jakearchibald's proposal we end up adding a header. We might as well allow developers to customize its contents.

- No cookie API exists for service workers right now. It's nice to talk in the abstract about how it'd be nice to have one down the road, but as it stands preload would be much less useful for us until something like that was made. Such an API seems tangential from this.

- We already allow developers to add custom headers to requests objects that they are making as a result of a fetch event. If the goal of preload is to allow for similar requests earlier then to me it seems like we should try to get as much of the fetch functionality as is reasonable. (More developer control > less developer control)

Would there be issues with allowing custom data to be set on a X-Service-Worker-Preload header?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/920#issuecomment-247144874

Received on Wednesday, 14 September 2016 20:35:59 UTC