Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Cache Control Max Age

default discord avatar
thefrontend2 years ago
2

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
    2 years 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
    phewbar2 years ago

    Did you find a solution?

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.