w3c / beacon

Beacon
https://w3c.github.io/beacon/
Other
46 stars 22 forks source link

Should sendBeacon set the FetchRequest's cacheMode to "no-cache"? #48

Closed cdumez closed 6 years ago

cdumez commented 6 years ago

Should sendBeacon set the FetchRequest's cacheMode to "no-cache"?

Based on code introspection, Blink seems to bypass the cache by adding "max-age=0" Cache-control header on the request. I don't know about Gecko.

Seems to me that sendBeacon() should bypass the cache.

igrigorik commented 6 years ago

Tracing back, it looks like that was introduced in original implementation in Blink. Testing in FF, I don't see max-age or any other cache-related request headers. @nolanlawson @toddreifsteck Edge?

Seems to me that sendBeacon() should bypass the cache.

Curious, what makes you say that? It's not obvious to me why we should special case sendBeacon; seems like the decision should rest with the endpoint. Also, if we special case sendBeacon, then we should also think about the "keepalive" flag in Fetch.. and there I think it makes even less sense?

/cc @tyoshino

igrigorik commented 6 years ago

nudge

@cdumez any followup thoughts or questions on this one? As stated above, I don't believe we should be special casing this. As next steps, I propose we (a) open a Chrome bug to remove max-age=0 and (b) close this with no action on the spec. Does that sound reasonable?

cdumez commented 6 years ago

Ok.

igrigorik commented 6 years ago

Thanks! Filed Chrome bug: https://crbug.com/755725