Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
geek-caroline opened this issue Sep 23, 2013 · 1 comment
Open

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

geek-caroline opened this issue Sep 23, 2013 · 1 comment

Comments

@geek-caroline
Copy link

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?

@jacargentina
Copy link

@geek-caroline I needed this, so i've implemented on my own fork. Now sending the PR to upstream. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants