Problem/Motivation

Noticed the pre-check and post-check directives for the Cache-control header today. Found this info by Eric Lawrence formerly of Microsoft that says:

If both post-check and pre-check are specified and set to 0, both are entirely ignored.

Not even sure if they are supported in latest IE/Edge.

Either way the way we have them set doesn't do anything for IE like it was intended and wastes bandwidth and header processing cycles.

Doesn't affect the mergeability of this patch but here is a question to find out if they are supported, if for some reason we actually wanted to use them correctly.

http://stackoverflow.com/questions/34663916/are-cache-control-pre-check-...
https://twitter.com/ElijahLynn/status/685195442498473985

Proposed resolution

Remove the directives from our Cache-control headers.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

Elijah Lynn created an issue. See original summary.

elijah lynn’s picture

Status: Active » Needs review
StatusFileSize
new3.68 KB
elijah lynn’s picture

Issue summary: View changes
elijah lynn’s picture

Issue summary: View changes

Eric just replied on Twitter supporting the removal of them:

Yeah, short answer is that nobody should use these and all uses of "p*check=0" are junk.

https://twitter.com/ericlaw/status/685201170260819968

I left p*check support in WinINET in the IE9 rewrite & I doubt removed since, but urge you to not use.

https://twitter.com/ericlaw/status/685201463987929088

elijah lynn’s picture

Issue tags: +internet explorer

Status: Needs review » Needs work

The last submitted patch, 2: 2646280-pre-check-post-check-headers-2.patch, failed testing.

elijah lynn’s picture

Status: Needs work » Needs review
StatusFileSize
new3.69 KB
new865 bytes

Yay for tests!

I was a little to aggressive and removed a 'no-cache' directive. It is back now.

cweagans’s picture

Status: Needs review » Reviewed & tested by the community

Nice!

bleen’s picture

RTBC++

wim leers’s picture

Oh dear deity, yes, please! :)

In fact, I think this could be applied to 8.0.x too. I'll leave that up to the committer to decide though.

  • catch committed b746956 on 8.1.x
    Issue #2646280 by Elijah Lynn: Remove IE pre-check and post-check Cache-...
catch’s picture

Version: 8.1.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Theoretically the header change could break contrib or custom tests looking for the default headers. For that reason, I've committed/pushed to 8.1.x only.

Moving directly to 7.x for backport. If someone feels strongly this should go into 8.0.x then feel free to move it back there for discussion.

wim leers’s picture

Version: 7.x-dev » 8.1.x-dev
Component: cache system » request processing system
Status: Patch (to be ported) » Fixed

Theoretically the header change could break contrib or custom tests looking for the default headers.

AFAICT this means it cannot be backported to D7 for the same reason it cannot be backported to D8. Even more so because Drupal 7 sites will often be used in strictly controlled environments, which may include the use of IE.

David_Rothstein’s picture

Version: 8.1.x-dev » 7.x-dev
Status: Fixed » Patch (to be ported)

Well if it's true they serve no purpose for any version of IE (and it sounds like they don't) it's safe to remove from Drupal 7 too.

On the other hand it doesn't sound like they are causing any harm either...?

I'm not too worried about broken contrib tests because it seems like it would be pretty rare (and if you're trying to assert the page was cached there are better, less fragile ways to do it). We would mention this in the release notes too so it would be easy to find if a test was broken.

pietmarcus’s picture

Assigned: Unassigned » pietmarcus
Status: Patch (to be ported) » Needs review
StatusFileSize
new2.74 KB

I've ported the functionality of the patch to D7. There was only one instance in code and two in testscripts.

pietmarcus’s picture

I've backported the functionality in the patch to d7.

pietmarcus’s picture

I have backported the patch for drupal 7. That is to say, I've removed all instances of the post-check header that I could find, and updated the tests. Somehow the patch is uploaded but not linked to my original post (which hasn't been posted btw), so I hope that's not a problem.

David_Rothstein’s picture

I went ahead and published the last few comments (including your patch) - I am not sure why drupal.org forced them to be unpublished. Thanks for posting the patch!

elijah lynn’s picture

elijah lynn’s picture

Status: Needs review » Reviewed & tested by the community

Just tested this and applies nicely and removes the headers as expected. RTBCing to move the discussion along.

David_Rothstein’s picture

The patch looks good to me too.

I'm going to hold off one more release on this, just in case it does turn out to be disruptive to contrib tests - this would be a good fit for #2598382: [policy] Adopt a 6-month feature release schedule for Drupal 7 (similar to Drupal 8) and use pseudo-semantic versioning if we wind up doing that (in that case it would be included in a release on April 20).

So a little bit of a wait, but this should be able to get committed soon either way.

David_Rothstein’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +7.50 release notes

Committed to 7.x - thanks!

Note that the release that includes this will probably be labeled Drupal 7.50 to indicate it contains some big changes

  • David_Rothstein committed 65b71ab on 7.x
    Issue #2646280 by Elijah Lynn, pietmarcus: Remove IE pre-check and post-...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.