Options passed when invoking cache() to create a route-level middleware.
cache()
// This route uses a 10-second TTL instead of the global 60-second TTL.app.get('/products', cache({ ttl: 10_000 }), handler); Copy
// This route uses a 10-second TTL instead of the global 60-second TTL.app.get('/products', cache({ ttl: 10_000 }), handler);
Optional
Time-to-live override for this specific route, in milliseconds. Takes precedence over the global ttl set in MemorizeOptions. Pass 0 or omit to fall back to the global TTL.
ttl
0
Options passed when invoking
cache()to create a route-level middleware.Example