-
Notifications
You must be signed in to change notification settings - Fork 22
feat: add experimental cache-handlers support #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next16
Are you sure you want to change the base?
Conversation
| const handlersList: Handler<CacheHandlersValue>[] = config.handlers.filter( | ||
| (handler) => !!handler, | ||
| ); | ||
| const memoryCache = createMergedHandler(handlersList); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why memoryCache as this is merged from multiple handlers, possibly redis as well?
I think this implementation is quite naive in a sense that it only "makes it work" without addressing the actual implementation of the new interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opps, i forgot rename that. I tho was using it with redis and LRU
|
Thank you for your contribution @H01001000. However I'll keep it on hold as a reference for now. I need a better overview of what needs to be done and I don't think wrapping handlers with a decorator that does this: is a way to go. Nevertheless, it's quite a bit of exploration work already done, thank you for that! |
|
Yea, totally. for refreshTags, getExpiration. I think when Vercel created cachehandlers, they have two tag invalidation patterns in mind.
A bit wordy but hope you understand, tho its just my interpretation of their docs |
|
@H01001000 would you consider updating your branch to the latest next16 branch and renaming the |
This PR adds experimental support for Next 16 cache component cache handlers.
To do so:
This, for now allows no interface change for cache-handler user. While to use cache-handlers, user need to cast handler for CacheHandlersValue type
Haven't in-depth test a lot, but it works
Example usage