Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 5 commits into from
Oct 10, 2023

Conversation

DeVmend
Copy link
Contributor

@DeVmend DeVmend commented Sep 11, 2023

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.

@eneajaho
Copy link
Member

Hello @Pii2
Thank you very much for this! This feature makes sense!
I would really like if we could have some docs for this feature so users can see and use it too!

I would like to have the cachKey renamed to cacheKey.

@DeVmend
Copy link
Contributor Author

DeVmend commented Sep 15, 2023

Hi @eneajaho,
And thank you!

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

@github-actions github-actions bot added the 📚 Docs Web Documentation hosted on github pages label Sep 20, 2023
@DeVmend
Copy link
Contributor Author

DeVmend commented Sep 20, 2023

Hi @eneajaho !
I have added documentation on how to use the feature. Currently it is the last chapter, please feel free to rearrange the order as you like.

Also let me know if you are still missing something.

Best regards

@eneajaho
Copy link
Member

@Pii2 Can you rebase the branch so we can merge this? Thank you again for this!

@DeVmend DeVmend force-pushed the isr-cache-multiple-variants branch from 59ef379 to 8cb8673 Compare October 10, 2023 07:48
@DeVmend
Copy link
Contributor Author

DeVmend commented Oct 10, 2023

Hi @eneajaho :)
I hope it worked.
It was a pleasure!

@eneajaho eneajaho enabled auto-merge (squash) October 10, 2023 07:52
@eneajaho eneajaho merged commit 084f4fa into rx-angular:main Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 Docs Web Documentation hosted on github pages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants