Skip to content

Commit 51d24f3

Browse files
committed
Add Cache-Control and Expires headers to tagged responses
1 parent 4ca6e12 commit 51d24f3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Response/FileDownloadResponse.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ public function createPsrResponse()
113113
->withHeader('Pragma', 'public');
114114

115115
if ($this->cache_hash) {
116-
$response = $response->withHeader('Etag', '"' . trim($this->cache_hash, '"\'') . '"');
116+
$response = $response
117+
->withHeader('Expires', gmdate('D, d M Y H:i:s', (time() + 315360000)) . ' GMT')
118+
->withHeader('Cache-Control', 'public, max-age=0')
119+
->withHeader('Etag', '"' . trim($this->cache_hash, '"') . '"');
117120
} else {
118121
$response = $response
119122
->withHeader('Expires', '0')

0 commit comments

Comments
 (0)