payload icon indicating copy to clipboard operation
payload copied to clipboard

feat(storage-s3): add cacheControl config option

Open jhb-dev opened this issue 4 months ago • 0 comments

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 cacheControl property 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 cacheControl string is passed to the AWS.putObjectCommand function on upload

jhb-dev avatar Oct 30 '25 10:10 jhb-dev