-
Notifications
You must be signed in to change notification settings - Fork 212
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
RFC: Response cache #985
base: main
Are you sure you want to change the base?
RFC: Response cache #985
Conversation
|
7f31f1a
to
c42ca1c
Compare
c42ca1c
to
b8b1987
Compare
@yusukebe Hy, could you check this out please? :) Still very basic, no tests even yet, just to get feeling/idea if there would be interest to continue with this |
At first glance, I don't think this is needed. We already have the built-in Cache Middleware. If you want to cache just "Response", it's enough to use it. |
As per my understanding, that middleware only works on cloudflare an deno, and uses specific cache mechanism. This allows little bit more freedom, for example, by using Also, correct me if I'm wrong, but that Cache API helps cache'ing it on Cloudflare/DenoDeploy level, basically "edge/cdn" rather than on server, right? |
Forgot to mention - this allows to customize cache’ing keys. So for example, if you’re running A/B test, and store A/B tests list in cookie - you can use that cookie to allow to cache page rendered under specific A/B conditions. Quite niche example, but solution is quite lightweight with provided flexibility. |
Thank you for the explanation! Makes sense.
Yes. The Cache API is standardized, but you can only use it in particular runtimes like Cloudflare Workers and Deno. This middleware looks good. Let's go ahead. |
The author should do the following, if applicable
yarn changeset
at the top of this repo and push the changeset