Cache Control Max Age

default discord avatar
9 months ago

Is there a way to set a cache-control: max-age header for uploading images? I'm using the S3 adapter so I'm not sure this should be implemented somewhere globally within Payload or inside the plugin config.

  • discord user avatar
    Payload Team
    8 months ago

    Currently, we allow passing through the


    package's options into


    on the payload config. I do not see anything in their docs about setting headers, so this might be something we'll need to add. What would be the ideal experience for this in your mind? Allowing a headers object or function to allow header logic? We're definitely open to allowing this.

    We allow custom express middleware to be passed through, but this would obviously have to have logic around when to set the cache-control header, because you wouldn't want it on every request.

  • default discord avatar
    5 months ago

    Did you find a solution?

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!


Connect with the Payload Community on Discord



Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.