diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-03-21 08:27:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-21 08:27:09 +0100 |
commit | c8340ace5c22b3a3cf2132b2efbe91104aab04e9 (patch) | |
tree | 2eca95d6573e3b072151a8f036df134d326feb00 /tests | |
parent | af3ab1de107e5ecea65a9a95a790d72f02684bb4 (diff) | |
parent | 796b4f19f8f8f8a989e122fd603ce8db9daa0fc7 (diff) | |
download | nextcloud-server-c8340ace5c22b3a3cf2132b2efbe91104aab04e9.tar.gz nextcloud-server-c8340ace5c22b3a3cf2132b2efbe91104aab04e9.zip |
Merge pull request #7904 from nextcloud/fix_7224
Add Cache-control: immutable
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Core/Controller/CssControllerTest.php | 12 | ||||
-rw-r--r-- | tests/Core/Controller/JsControllerTest.php | 12 |
2 files changed, 12 insertions, 12 deletions
diff --git a/tests/Core/Controller/CssControllerTest.php b/tests/Core/Controller/CssControllerTest.php index c78233d8917..8ec15f449a0 100644 --- a/tests/Core/Controller/CssControllerTest.php +++ b/tests/Core/Controller/CssControllerTest.php @@ -109,10 +109,10 @@ class CssControllerTest extends TestCase { ->willReturn($file); $expected = new FileDisplayResponse($file, Http::STATUS_OK, ['Content-Type' => 'text/css']); - $expected->cacheFor(86400); + $expected->addHeader('Cache-Control', 'max-age=31536000, immutable'); $expires = new \DateTime(); $expires->setTimestamp(1337); - $expires->add(new \DateInterval('PT24H')); + $expires->add(new \DateInterval('PT31536000S')); $expected->addHeader('Expires', $expires->format(\DateTime::RFC1123)); $expected->addHeader('Pragma', 'cache'); @@ -137,10 +137,10 @@ class CssControllerTest extends TestCase { $expected = new FileDisplayResponse($gzipFile, Http::STATUS_OK, ['Content-Type' => 'text/css']); $expected->addHeader('Content-Encoding', 'gzip'); - $expected->cacheFor(86400); + $expected->addHeader('Cache-Control', 'max-age=31536000, immutable'); $expires = new \DateTime(); $expires->setTimestamp(1337); - $expires->add(new \DateInterval('PT24H')); + $expires->add(new \DateInterval('PT31536000S')); $expected->addHeader('Expires', $expires->format(\DateTime::RFC1123)); $expected->addHeader('Pragma', 'cache'); @@ -170,10 +170,10 @@ class CssControllerTest extends TestCase { ->willReturn('gzip, deflate'); $expected = new FileDisplayResponse($file, Http::STATUS_OK, ['Content-Type' => 'text/css']); - $expected->cacheFor(86400); + $expected->addHeader('Cache-Control', 'max-age=31536000, immutable'); $expires = new \DateTime(); $expires->setTimestamp(1337); - $expires->add(new \DateInterval('PT24H')); + $expires->add(new \DateInterval('PT31536000S')); $expected->addHeader('Expires', $expires->format(\DateTime::RFC1123)); $expected->addHeader('Pragma', 'cache'); diff --git a/tests/Core/Controller/JsControllerTest.php b/tests/Core/Controller/JsControllerTest.php index 571318c89d0..3910045276b 100644 --- a/tests/Core/Controller/JsControllerTest.php +++ b/tests/Core/Controller/JsControllerTest.php @@ -109,10 +109,10 @@ class JsControllerTest extends TestCase { ->willReturn($file); $expected = new FileDisplayResponse($file, Http::STATUS_OK, ['Content-Type' => 'application/javascript']); - $expected->cacheFor(86400); + $expected->addHeader('Cache-Control', 'max-age=31536000, immutable'); $expires = new \DateTime(); $expires->setTimestamp(1337); - $expires->add(new \DateInterval('PT24H')); + $expires->add(new \DateInterval('PT31536000S')); $expected->addHeader('Expires', $expires->format(\DateTime::RFC1123)); $expected->addHeader('Pragma', 'cache'); @@ -137,10 +137,10 @@ class JsControllerTest extends TestCase { $expected = new FileDisplayResponse($gzipFile, Http::STATUS_OK, ['Content-Type' => 'application/javascript']); $expected->addHeader('Content-Encoding', 'gzip'); - $expected->cacheFor(86400); + $expected->addHeader('Cache-Control', 'max-age=31536000, immutable'); $expires = new \DateTime(); $expires->setTimestamp(1337); - $expires->add(new \DateInterval('PT24H')); + $expires->add(new \DateInterval('PT31536000S')); $expected->addHeader('Expires', $expires->format(\DateTime::RFC1123)); $expected->addHeader('Pragma', 'cache'); @@ -170,10 +170,10 @@ class JsControllerTest extends TestCase { ->willReturn('gzip, deflate'); $expected = new FileDisplayResponse($file, Http::STATUS_OK, ['Content-Type' => 'application/javascript']); - $expected->cacheFor(86400); + $expected->addHeader('Cache-Control', 'max-age=31536000, immutable'); $expires = new \DateTime(); $expires->setTimestamp(1337); - $expires->add(new \DateInterval('PT24H')); + $expires->add(new \DateInterval('PT31536000S')); $expected->addHeader('Expires', $expires->format(\DateTime::RFC1123)); $expected->addHeader('Pragma', 'cache'); |