Cache Control Max Age

default discord avatar
TheFrontend
9 months ago
3

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
    denolfe
    Payload Team
    8 months ago

    Currently, we allow passing through the

    express-fileupload

    package's options into

    upload

    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
    fewbar
    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!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

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