payload
payload copied to clipboard
feat(storage-s3): add cacheControl config option
This PR introduces a new optional cacheControl configuration option that allows developers to define the Cache-Control header for uploaded files.
This is particularly useful when using the disablePayloadAccessControl option, where files are served directly from S3. In such setups (for example, when using Hetzner S3), no cache headers are applied by default.
With this new option, developers can explicitly specify cache control policies to improve performance and ensure optimal browser caching behavior.
What?
- Added a new optional
cacheControlproperty to the S3 plugin configuration.
Why?
- Some S3-compatible providers (e.g. Hetzner) do not apply cache headers by default.
- When files are served directly from S3, missing cache headers can result in suboptimal performance.
How?
- When set, the
cacheControlstring is passed to theAWS.putObjectCommandfunction on upload