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
Is it possible to use the original nextjs cache (file-system-cache?) rather than falling back to lru-cache? The use case here is that we would like to try using Redis as a cache store for some, but not all, of our cached fetches.
In createCompositeHandler, is there any way to get a handle to the original cache functionality?
// This example uses composite handler to switch from Redis to LRU cache if tags contains `memory-cache` tag.// You can skip composite and use Redis or LRU only.global.cacheHandlerConfig={handlers: [createCompositeHandler({handlers: [lruCache,createBufferStringHandler(redisCacheHandler),// Use `createBufferStringHandler` in Next15 and ignore it in Next14 or below],setStrategy: (ctx)=>(ctx?.tags.includes("memory-cache") ? 0 : 1),// You can adjust strategy for deciding which cache should the composite use}),],};
Using LRU cache as the fallback in production is flagged:
⚠️ The local-lru Handler is not suitable for production environments. It is intended for development and testing purposes only.
So it would be nice to know that if our Redis service went belly up that we would go back to the stock functionality rather than something which is not intended for production
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to use the original nextjs cache (
file-system-cache
?) rather than falling back to lru-cache? The use case here is that we would like to try using Redis as a cache store for some, but not all, of our cached fetches.In
createCompositeHandler
, is there any way to get a handle to the original cache functionality?Using LRU cache as the fallback in production is flagged:
So it would be nice to know that if our Redis service went belly up that we would go back to the stock functionality rather than something which is not intended for production
Beta Was this translation helpful? Give feedback.
All reactions