On Demand Pre-Render
Do you want to request a feature or report a bug?
Feature On Demand Pre-Render
What is the current behaviour? I can pre-render only while building using
preact build --prerenderUrls ./prerender.js
After the build is created, I am not able to pre-render without deleting previous build.
I am building an E-commerce site, when new products are added, I want to pre-render them and only those product pages, keeping rest of my previous build. Is it possible to create a system, when new pages are pre-rendered on demand?
I don't want SSR for sure!
This is a very interesting idea. @developit we should probably do this
@Debdut curious about your use case, where and when would you like to trigger this additional prerendering?
- Where? Would this be on the CI server or on the actual web server?
- When? Would you trigger this when you add an item via some webhook or when the request comes?
I trigger this when a request comes in
If you create partial builds which can attach to previous build without deleting it, it works too
I trigger this when a request comes in
So basically cached SSR?
Yeah, thanks for the terminology
I wonder what would the setup look like?
- A request comes in, you check if the URL is already pre-rendered
- You call a function in
preact-cli - It generates the file for this and future requests
- Future requests serve from previously prerendered file?
or
- Introduce a server which does SSR for you and serve stale responses upto a given time
First one sounds better