-
-
Notifications
You must be signed in to change notification settings - Fork 204
feat(isr): add the possibility to create the cache in several variants #1608
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
feat(isr): add the possibility to create the cache in several variants #1608
Conversation
Hello @Pii2 I would like to have the |
Hi @eneajaho, I'm glad to hear that the feature has received positive feedback. I will work on a documentation as soon as I am back from my vacation :) Best regards |
Hi @eneajaho ! Also let me know if you are still missing something. Best regards |
@Pii2 Can you rebase the branch so we can merge this? Thank you again for this! |
Co-authored-by: Enea Jahollari <[email protected]>
Co-authored-by: Enea Jahollari <[email protected]>
59ef379
to
8cb8673
Compare
Hi @eneajaho :) |
Implementation for Issue #1604
This implementation has no breaking changes. It allows to specify different variants of the cache, e.g. for users who have a cookie to verify their logged in status. If no additional variants are specified, the functionality is unchanged. Also no modification to existing CacheHandler implementations is necessary.
Any number of variants can be specified via the ISRHandler configuration.
Each variant has an identifier and a callback function that recognizes the variant for a given request.
To enable on-demand cache invalidation, a simulateVariant function can also be specified, which can modify the request so that it can be identified for the variant.