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
Cache-control header not set #122
Comments
Also had this problem. Resorting to setting the headers manually using this gist: https://gist.github.com/tagr/170627486377551831de |
The middleware adds a cache-control max-age (equal to the apicache duration). However, it looks like this header value is not cached (I guess because this header is added on the fly, after the cache is created). Therefore, it’s missing when a resource is served from the cache, unless you had already set a cache-control header from your http framework (in such case, this value is cached and served on subsequent requests). By the way, I notice the middleware overwrites any existing cache-control header... I would expect it to not overwrite that value. And perhaps even change its cache duration to that existing max-age value. What do you think? Edit: see https://github.com/kwhitley/apicache/blob/master/src/apicache.js#L168 |
I also have this issue where I wish the cache duration would be set from the Max Age header instead of the opposite. I am running Nuxt as a serverside rendering framework for VueJS. Every cache duration is specifically handled. It's quite a shame to end up putting a default value for everything with header override feature. Can we have a way to deactivate this feature and let the cache related header to what they are ? |
I have fixed this issue with pull request #154. Please incorporate! It looks like there has been no activity on this project for over 6 months. |
Cache-control header is not set when
apicache
is serving cached content.The text was updated successfully, but these errors were encountered: