I am using koa-static to serve my assets.
I have set max-age to a minute for now 60000ms (as described in the docs)
For testing purposes, I am using a big image as a background in my page, but it seems that the browser still re-downloads it every time the page is opened anyway...
Here is the related code:
var app = require('koa')(),
serve = require('koa-static');
Are you sure this is not a problem with your browser instead of koa-static? I tried your example as is, but instead of using a browser i used curl to check out the headers:
curl -I http://localhost:3000/img.png
You will see that the max-age header is set to one minute as desired. It seems the cache-control was set to what we wanted, so it must be your browser doing something tricky with the headers. For example, if you are using chrome, it will set max-age=0 in certain situations:
Hope this helps!