Skip to content

How do I change cache control headers on responses? #48

@geek-caroline

Description

@geek-caroline

So far as I can tell, there is no way for me to set my own cache-control headers on assets.

I've tried using serveModify, but it looks to me like any settings I put here for 'Cache-Control' or 'Expires' are overwritten by lines 388 / 399:

'Cache-Control': 'public,max-age=' + 31536000,
'Expires': response.expires || (new Date(new Date().getTime()+63113852000)).toUTCString(),

So am I correct in saying I am unable to set a bespoke max-age for an asset?

I don't want my files to have a max-age of a year, I would prefer something closer to an hour as they may well change.

I'm not sure however if I've misunderstood something in the implementation but it appeared to me that others may have used the serveModify method to overwrite the default headers but I do not seem able to?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions