http - koa-static not following max-age -


i using koa-static serve assets. have set max-age minute 60000ms (as described in docs)

for testing purposes, using big image background in page, seems browser still re-downloads every time page opened anyway...

here related code:

var app        = require('koa')(),     serve      = require('koa-static');  app.use(serve('./public', {   maxage: 60000, })) 

how can fix this?

are sure not problem browser instead of koa-static? tried example is, instead of using browser used curl check out headers:

if curl -i http://localhost:3000/img.png

you see max-age header set 1 minute desired. seems cache-control set wanted, must browser doing tricky headers. example, if using chrome, set max-age=0 in situations:

chrome doesn't cache images/js/css

hope helps!


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -