koajs / static-cache

[MAINTAINERS WANTED] Static cache for koa
293 stars 47 forks source link

'dynamic' option is not working #101

Closed owendswang closed 2 years ago

owendswang commented 2 years ago

Describe the bug

'dynamic' option is not working.

OS version: Ubuntu 20.04 x64 Node v16

Description: Even set 'dynamic' to true, new uploaded files cannot be get and got 404 instead.

Actual behavior

Even set 'dynamic' to true, new uploaded files cannot be get and got 404 instead.

Expected behavior

Get new uploaded files, not 404.

Code to reproduce

app.use(staticCache(path.join(__dirname, './uploads'), { prefix: '/uploads', maxAge: 30 * 24 * 60 * 60, dynamic: true })); or app.use(mount('uploads', staticCache(path.join(__dirname, './uploads'), { maxAge: 30 * 24 * 60 * 60, dynamic: true })));

Checklist

owendswang commented 2 years ago

Sorry. I didn't upload the fixed one to production. It works.