Skip to content

Commit 0185b03

Browse files
committed
Cache headers added
1 parent 7c781c5 commit 0185b03

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/Photo.php

+6
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,13 @@ public static function upload(UploadedFile $file)
123123
[
124124
'StorageClass' => config('whatthetag.s3_storage_class', 'STANDARD'),
125125
// https://github.com/thephpleague/flysystem-aws-s3-v3/blob/dc56a8faf3aff0841f9eae04b6af94a50657896c/src/AwsS3Adapter.php#L387
126+
127+
// Set visibility to public
126128
'ACL' => 'public-read',
129+
130+
//Let's add a year for cache headers:
131+
'CacheControl' => 'max-age=31536000, public',
132+
'Expires' => gmdate("D, d M Y H:i:s", time() + 31536000) . " GMT",
127133
]
128134
);
129135

0 commit comments

Comments
 (0)