-
Notifications
You must be signed in to change notification settings - Fork 24
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
Allow to bypass .send on a cache miss #63
Comments
Hey, although some people used cacheable-response in the past with Next.js, just I warn about the fact cacheable-response is a general-purpose library rather than a specific Next.js solution. Saying that I feel cacheable-response as general-purpose library should handle the response properly. If Next.js should skip sending function under determinate situations, then the library should provide the basics primitives for doing that.
so correct if I am wrong (mainly because I'm not using Next.js with cacheable-response), just passing Can you promote this into a PR? 🙂 |
Sorry, I should have been more accurate in my proposal:
If this enhancement makes sense to you, I'll work on a PR. |
I think this is closely related to #64 (comment) I want to make this library Next.js friendly, but keeping in mind this is not a Next.js specific solution. I'm very welcome to accept a PR doing the library easy to connect if the current functionality keeps the same. so feel free to open a PR 🙂 |
Next.js example
ssr-caching
is currently broken (vercel/next.js#16372, vercel/next.js#16725) because there is no way to have Next.js ssr-render the page content on a cache miss without it also writing and.end
-ing the response. Previous versions of the example relied onapp.renderToHTML
which has been deprecated because it's an internal API (vercel/next.js#14737).I suggest we add a flag to bypass the
.send()
incacheable-response
when a cache miss happens, for those cases where the framework takes care of thereq
/res
lifecycle till the end. We can add it either as an option incacheableResponse({})
or as a property of.get()
's return value.The text was updated successfully, but these errors were encountered: