Skip to content

Commit

Permalink
[4.0] Cache-Control post-check and pre-check (#36391)
Browse files Browse the repository at this point in the history
* [4.0] Cache-Control post-check and pre-check

This PR (and the associated pr in the framework) kills the references to post-check and pre-check from the headers. These are non-standard directives introduced in ie5 and killed in ie7 and do nothing today except wasting bytes and bandwidth.

Ref: https://www.fastly.com/blog/cache-control-wild

* Update CMSApplication.php

oops
  • Loading branch information
brianteeman authored Dec 26, 2021
1 parent a444e83 commit 63d4e65
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libraries/src/Application/CMSApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ protected function route()

$this->setHeader('Expires', 'Wed, 17 Aug 2005 00:00:00 GMT', true);
$this->setHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT', true);
$this->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', false);
$this->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate', false);
$this->sendHeaders();

$this->redirect((string) $oldUri, 301);
Expand Down
2 changes: 1 addition & 1 deletion plugins/system/languagefilter/languagefilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ public function parseRule(&$router, &$uri)
// We cannot cache this redirect in browser. 301 is cacheable by default so we need to force to not cache it in browsers.
$this->app->setHeader('Expires', 'Wed, 17 Aug 2005 00:00:00 GMT', true);
$this->app->setHeader('Last-Modified', gmdate('D, d M Y H:i:s') . ' GMT', true);
$this->app->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', false);
$this->app->setHeader('Cache-Control', 'no-store, no-cache, must-revalidate', false);
$this->app->sendHeaders();
}

Expand Down

0 comments on commit 63d4e65

Please sign in to comment.