New issue
Advanced search Search tips

Issue 755725 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

[Beacon API] sendBeacon requests append unnecessary "Cache-Control: max-age=0"

Project Member Reported by igrigo...@google.com, Aug 15 2017

Issue description

Chrome Version: 60.0.3112.101

What steps will reproduce the problem?
(1) emit a request via navigator.sendBeacon()
(2) Request header advertises "Cache-Control: max-age=0"

What is the expected result?
Chrome should not emit any special CC request headers. 

What happens instead?
Chrome appends a CC:max-age=0 header to sendBeacon requests, which is not required by Beacon API spec. FF and Edge do not append such CC headers.

Additional context and discussion: https://github.com/w3c/beacon/issues/48
 

Comment 1 by ricea@chromium.org, Aug 17 2017

Components: -Blink>PerformanceAPIs
Status: Assigned (was: Untriaged)
There doesn't appear to be any need for the header. IIRC, POST requests are never served from the cache.

Probably a FYI to blink-dev would be appropriate.
The original patch and its review don't include any discussion explaining the reason why we have this. We can just remove it and then we'll be aligned with other browsers, yes.

https://chromium.googlesource.com/chromium/src/+/5c265c1a56a60533a1957589d33eabc201e2e8b6%5E%21/third_party/WebKit/Source/core/loader/BeaconLoader.cpp

> Probably a FYI to blink-dev would be appropriate.

I'll send a PSA.
This is the revision of the Beacon spec referred by the patch that was active when the patch was landed.
https://dvcs.w3.org/hg/webperf/raw-file/b57594c11196/specs/Beacon/Overview.html
Owner: yhirano@chromium.org
Reassigning to yhirano@.
Project Member

Comment 6 by bugdroid1@chromium.org, Mar 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3c032f9d5bf7a7f60941c2baa3714b0f04705ea6

commit 3c032f9d5bf7a7f60941c2baa3714b0f04705ea6
Author: Yutaka Hirano <yhirano@chromium.org>
Date: Thu Mar 08 04:02:44 2018

Stop attaching 'cache-control: max-age=0' in sendBeacon

We've attached the header to requests initiated by sendBeacon() but it
is not spec conformant. Let's stop doing that.

Bug:  755725 
Change-Id: Ia8b85a27b84c77b35edc211c325490467c853330
Reviewed-on: https://chromium-review.googlesource.com/952104
Reviewed-by: Adam Rice <ricea@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541719}
[modify] https://crrev.com/3c032f9d5bf7a7f60941c2baa3714b0f04705ea6/third_party/WebKit/Source/core/loader/PingLoader.cpp

Status: Fixed (was: Assigned)

Sign in to add a comment