Skip to content

Commit 9634468

Browse files
committed
[FIX] 0031298: Init/Session/WAC: Expire HTTP header makes static ressources uncacheable
1 parent 096242e commit 9634468

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Services/FileDelivery/classes/Delivery.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ final class Delivery
2929
const DIRECT_PHP_OUTPUT = 'php://output';
3030
const DISP_ATTACHMENT = 'attachment';
3131
const DISP_INLINE = 'inline';
32+
const EXPIRES_IN = '+5 days';
3233
/**
3334
* @var integer
3435
*/
@@ -195,7 +196,7 @@ public function setCachingHeaders()
195196
{
196197
$response = $this->httpService->response()->withHeader(ResponseHeader::CACHE_CONTROL, 'must-revalidate, post-check=0, pre-check=0')->withHeader(ResponseHeader::PRAGMA, 'public');
197198

198-
$this->httpService->saveResponse($response);
199+
$this->httpService->saveResponse($response->withHeader(ResponseHeader::EXPIRES, date("D, j M Y H:i:s", strtotime(self::EXPIRES_IN)) . " GMT"));
199200
$this->sendEtagHeader();
200201
$this->sendLastModified();
201202
}

0 commit comments

Comments
 (0)