Cache-control (and other) metadata for Amazon S3
bipinu opened this issue · 4 comments
bipinu commented
It would be nice to update file metadata so that it serves appropriate cache headers.
I followed this guideline: thephpleague/flysystem#141 (comment)
However, the following code doesn't seem to have any impact:
$this->flysystem->write($destLocation, $file, ['Cache-Control' => 'max-age=3153600, public']);
Am I missing something?
GrahamCampbell commented
D'no, but this is unrelated to my wrapper. Sorry I can't be any help.
bipinu commented
Is there a way to pass metadata/options using your wrapper?
GrahamCampbell commented
Yes. In exactly the same way. We're just forwarding function calls dynamically.
danmichaelo commented
For others who google this and end up here: The fix is to change 'Cache-Control' to 'CacheControl', per https://github.com/thephpleague/flysystem-aws-s3-v2/blob/master/src/AwsS3Adapter.php#L32