GrahamCampbell/Laravel-Flysystem

Cache-control (and other) metadata for Amazon S3

bipinu opened this issue · 4 comments

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?

D'no, but this is unrelated to my wrapper. Sorry I can't be any help.

Is there a way to pass metadata/options using your wrapper?

Yes. In exactly the same way. We're just forwarding function calls dynamically.

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