Closed oliversalzburg closed 8 years ago
Hi @oliversalzburg, I'll fix it.
Please download this module from GitHub and try the cache. I have fixed it. I'm waiting for your feedback
@petersirka Thanks a lot for the quick change! However, what I had in mind was to be able to specify for how long the file should be cached.
We're using node-filestorage
to serve user avatars. They are currently cached for a very long time in the browser cache. Some caching is definitely desired, but we would prefer to set a max-age
of like 5 minutes. So that users will see updated avatars in a reasonable time.
@petersirka We've combined your fix with a changed approach on our side and it's working great now. If you would make an npm release for 1.4.0 that would be awesome.
Thanks for your work :)
Hi @oliversalzburg, so can I publish the module into the NPM? Or do you need some change? If yes, can you create a pull request? Thanks
@petersirka Seems to work fine. We're currently deploying your latest changes to our development servers for final testing. But a release to NPM would be great for us :)
Great. I have publish it into the NPM. Thanks.
When I
.pipe()
a file into an Express response object, theCache-Control
header will be set topublic
, with nomax-age
part. Also, theExpires
header is set for 2 months.In some cases, this might be undesirable. An option to control this behavior would be much appreciated :)