You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, with cache middleware, once it is cached, it is never updated. I'd like to keep the cache on the server side for short periods of time, but that's currently cumbersome. So, we introduce the concept of expiration time in cache middleware.
Add the duration option and store it in an internal header when the cache matches and check it, as in the example below.
app.use(cache({cacheName: 'my-app',cacheControl: 'max-age=60',duration: 120// new optionwait: true,}))
The text was updated successfully, but these errors were encountered:
Just to add some background information, it's fair to say that cache middleware won't work properly with Deno because Cloudflare Workers respects the Cache-Control header, but Deno doesn't.
I don't use Deno, but wouldn't it make more sense to make Deno respect the Cache-Control header with a Deno setting instead ? That is probably not what the issue is about though 🤔
I don't use Deno, but wouldn't it make more sense to make Deno respect the Cache-Control header with a Deno setting instead ? That is probably not what the issue is about though 🤔
Deno is just a JavaScript runtime and will not extend Cache API.
Since Cloudflare Workers is a service with CDN, it seems to be natural to consider extending the API.
What is the feature you are proposing?
Currently, with cache middleware, once it is cached, it is never updated. I'd like to keep the cache on the server side for short periods of time, but that's currently cumbersome. So, we introduce the concept of expiration time in cache middleware.
Add the
duration
option and store it in an internal header when the cache matches and check it, as in the example below.The text was updated successfully, but these errors were encountered: