koajs / discussions

KoaJS Discussions
2 stars 2 forks source link

koa-static: heavy caching issue #41

Open mkgn opened 5 years ago

mkgn commented 5 years ago

I am trying out Koa for a simple app. I have used koa-static as a middlewear to serve the /public directory. Middlewear works fine.

To run the app, I push the application to a local docker container. When running the app I found out that it caches the static files completely. Even if i completely remove entire directories it still serves those js/html files. Even a server restart doesn't seem to clear cache. Is it because koa-static may be keeping a separate set of files for cache delivery? Later I tried adding koa-no-cache to middlewear. But still doesn't seem to work.

I am not sure whether this is koa-static issue or something to do with Docker.

jonathanong commented 4 years ago

koa-static and koa-send do not cache

jonathanong commented 4 years ago

if you are changing files in production, you should probably be using an object storage service like S3 instead