Skip to content
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

On Demand Pre-Render #1456

Open
Debdut opened this issue Oct 30, 2020 · 9 comments
Open

On Demand Pre-Render #1456

Debdut opened this issue Oct 30, 2020 · 9 comments

Comments

@Debdut
Copy link

Debdut commented Oct 30, 2020

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?

@Debdut
Copy link
Author

Debdut commented Oct 30, 2020

I don't want SSR for sure!

@prateekbh
Copy link
Member

This is a very interesting idea. @developit we should probably do this

@prateekbh
Copy link
Member

@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?

@Debdut
Copy link
Author

Debdut commented Nov 23, 2020

I trigger this when a request comes in

@Debdut
Copy link
Author

Debdut commented Nov 23, 2020

If you create partial builds which can attach to previous build without deleting it, it works too

@ForsakenHarmony
Copy link
Member

I trigger this when a request comes in

So basically cached SSR?

@Debdut
Copy link
Author

Debdut commented Dec 7, 2020

Yeah, thanks for the terminology

@prateekbh
Copy link
Member

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

@Debdut
Copy link
Author

Debdut commented Dec 7, 2020

First one sounds better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants