-
-
Notifications
You must be signed in to change notification settings - Fork 976
Open
Labels
enhancementNew feature or request.New feature or request.
Description
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.
app.use(cache({
cacheName: 'my-app',
cacheControl: 'max-age=60',
duration: 120 // new option
wait: true,
}))Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request.New feature or request.