Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
b746956f
Commit
b746956f
authored
Jan 11, 2016
by
Nathaniel Catchpole
Browse files
Issue
#2646280
by Elijah Lynn: Remove IE pre-check and post-check Cache-control headers
parent
79ee24dd
Changes
3
Hide whitespace changes
Inline
Side-by-side
core/includes/install.core.inc
View file @
b746956f
...
...
@@ -993,7 +993,7 @@ function install_display_output($output, $install_state) {
$default_headers
=
array
(
'Expires'
=>
'Sun, 19 Nov 1978 05:00:00 GMT'
,
'Last-Modified'
=>
gmdate
(
DATE_RFC1123
,
REQUEST_TIME
),
'Cache-Control'
=>
'no-cache, must-revalidate
, post-check=0, pre-check=0
'
,
'Cache-Control'
=>
'no-cache, must-revalidate'
,
'ETag'
=>
'"'
.
REQUEST_TIME
.
'"'
,
);
$response
->
headers
->
add
(
$default_headers
);
...
...
core/lib/Drupal/Core/EventSubscriber/FinishResponseSubscriber.php
View file @
b746956f
...
...
@@ -263,7 +263,7 @@ protected function setResponseCacheable(Response $response, Request $request) {
* A response object.
*/
protected
function
setCacheControlNoCache
(
Response
$response
)
{
$response
->
headers
->
set
(
'Cache-Control'
,
'no-cache, must-revalidate
, post-check=0, pre-check=0
'
);
$response
->
headers
->
set
(
'Cache-Control'
,
'no-cache, must-revalidate'
);
}
/**
...
...
core/modules/page_cache/src/Tests/PageCacheTest.php
View file @
b746956f
...
...
@@ -263,7 +263,7 @@ function testPageCache() {
$this
->
drupalGet
(
'system-test/set-header'
,
array
(
'query'
=>
array
(
'name'
=>
'Foo'
,
'value'
=>
'bar'
)));
$this
->
assertFalse
(
$this
->
drupalGetHeader
(
'X-Drupal-Cache'
),
'Caching was bypassed.'
);
$this
->
assertTrue
(
strpos
(
strtolower
(
$this
->
drupalGetHeader
(
'Vary'
)),
'cookie'
)
===
FALSE
,
'Vary: Cookie header was not sent.'
);
$this
->
assertEqual
(
$this
->
drupalGetHeader
(
'Cache-Control'
),
'must-revalidate, no-cache,
post-check=0, pre-check=0,
private'
,
'Cache-Control header was sent.'
);
$this
->
assertEqual
(
$this
->
drupalGetHeader
(
'Cache-Control'
),
'must-revalidate, no-cache, private'
,
'Cache-Control header was sent.'
);
$this
->
assertEqual
(
$this
->
drupalGetHeader
(
'Expires'
),
'Sun, 19 Nov 1978 05:00:00 GMT'
,
'Expires header was sent.'
);
$this
->
assertEqual
(
$this
->
drupalGetHeader
(
'Foo'
),
'bar'
,
'Custom header was sent.'
);
...
...
@@ -452,12 +452,12 @@ public function testCacheableResponseResponses() {
// GET a URL, which would be marked as a cache miss if it were cacheable.
$this
->
drupalGet
(
'/system-test/respond-reponse'
);
$this
->
assertFalse
(
$this
->
drupalGetHeader
(
'X-Drupal-Cache'
),
'Drupal page cache header not found.'
);
$this
->
assertEqual
(
$this
->
drupalGetHeader
(
'Cache-Control'
),
'must-revalidate, no-cache,
post-check=0, pre-check=0,
private'
,
'Cache-Control header was sent'
);
$this
->
assertEqual
(
$this
->
drupalGetHeader
(
'Cache-Control'
),
'must-revalidate, no-cache, private'
,
'Cache-Control header was sent'
);
// GET it again, verify it's still not cached.
$this
->
drupalGet
(
'/system-test/respond-reponse'
);
$this
->
assertFalse
(
$this
->
drupalGetHeader
(
'X-Drupal-Cache'
),
'Drupal page cache header not found.'
);
$this
->
assertEqual
(
$this
->
drupalGetHeader
(
'Cache-Control'
),
'must-revalidate, no-cache,
post-check=0, pre-check=0,
private'
,
'Cache-Control header was sent'
);
$this
->
assertEqual
(
$this
->
drupalGetHeader
(
'Cache-Control'
),
'must-revalidate, no-cache, private'
,
'Cache-Control header was sent'
);
// GET a URL, which would be marked as a cache miss if it were cacheable.
$this
->
drupalGet
(
'/system-test/respond-public-response'
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment