I've read in a few answers here on StackOverflow that it's better to use the iisnode's static files configurations rather than let node.js handle it.
That's ok, but I just can't find a way to get it to work with the traditional configurarion for browse caching:
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
</staticContent>
When I'm using the node'js normal browse cache, that's how it's configured (and working):
app.use(express.static(path.join(__dirname, 'public'), {maxAge: 86400000}));
My questions, than, are:
<clientCache ...
to work in IISnode? Thanks
I basically gave up trying to use IIS to serve static files and started using the maxAge option of the default Express static middleware, but I quickly grew tired trying to setup Grunt workflows to make sure the names of my static files change when the contents change.
Ended up writing a bit of Node.js middleware called Electricity which I tried to make as a mostly drop in replacement to the default Express static middleware: https://github.com/mediocre/electricity
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.