Open lukeclewlow opened 7 years ago
I believe this would break existing apps. While I like the idea, if you want to cache your base page, wouldn't something like Ember-static-boot be more fitting?
I am open to calling next() as an opt-in rather than the default.
Its slightly more complicated than I made out, and we don't want to serve a static site. Just cache the result of the fastboot rendered page so fastboot doesn't need to render it if nothing will have changed to make that necessary. The fastboot part is still very much a necessity for us.
Opting in would be great as I can see that it could be a breaking change otherwise.
Would you mind opening a PR with this being an opt-in functionality? And from there we can see how we want to land this.
My use case is that I want to cache the HTML that is generated from Fastboot. I use fastboot-express-middleware as middleware with fastboot-app-server. This has an afterFastboot hook, which is only accessible on an error because
index.js line 51
res.send(html)
just returns the HTML rather than callingnext()
.What I currently do is replace that line with
next()
and pass through the html on the response object.Is this something that might be good to change, and how would it affect users not using fastboot-app-server?
Happy to make a pull request if you did think this was a valid change.