Commit b746956f authored by catch's avatar catch

Issue #2646280 by Elijah Lynn: Remove IE pre-check and post-check Cache-control headers

parent 79ee24dd
......@@ -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);
......
......@@ -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');
}
/**
......
......@@ -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');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment