ef4 / prember

Prerender Ember apps with Fastboot at build time.
MIT License
195 stars 17 forks source link

Request/Question: Can you render multiple pages at a time? #9

Open mansona opened 6 years ago

mansona commented 6 years ago

I haven't looked into this in any great detail but I'm currently pre-rendering roughly 2K pages in an ember app (each version of the ember guides) and it takes a long time.

I wonder if it were possible to speed up the process to "batch request" 10 or 20 pages at a time?

ef4 commented 6 years ago

Yes, this should be possible. Most likely we would want to fork multiple worker processes.

On Sat, Jan 20, 2018 at 12:42 PM Chris Manson notifications@github.com wrote:

I haven't looked into this in any great detail but I'm currently pre-rendering roughly 2K pages in an ember app (each version of the ember guides) and it takes a long time.

I wonder if it were possible to speed up the process to "batch request" 10 or 20 pages at a time?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ef4/prember/issues/9, or mute the thread https://github.com/notifications/unsubscribe-auth/AATfMt2BAng9ZjToo_NDwilQwETOEFWnks5tMiWJgaJpZM4RlhPf .

mansona commented 6 years ago

I will take a look when (if?) this becomes an issue for us during deployment 👍

midhunpm commented 5 years ago

@ef4 - I am also trying to do the same thing. I am fairly new to Ember. Would you please explain what do you mean by "fork multiple worker processes"? Or any references to the explanation will also be helpful. Thank you!

mansona commented 5 years ago

@midhunpm how many pages are you looking to prerender?

This isn't really an "Ember" thing per say 😂 it's more of a NodeJS thing. Essentially the original issue was related to "batching" the prerender process: https://github.com/ef4/prember/blob/master/lib/prerender.js#L122 to speed it up.

We eneded up not going down this line for the Ember Guides because we're rendering roughly 3K pages in about 10 mins every time we deploy https://travis-ci.org/ember-learn/guides-app/builds/461084204 and we figured that was "good enough" for our use cases 👍

ef4 commented 5 years ago

Node has experimental worker thread support now.

midhunpm commented 5 years ago

@mansona - I am trying to pre-render around 1400 pages. There is not much of dynamic content on these pages and it servers mostly like a brochure page to our application. And above all that to leverage SEO benefit we decided to pre-render these pages and serve them as static html files. I hope this is a good idea!

mansona commented 5 years ago

@midhunpm how often do you pre-render it? like I said we are getting a 10 mins build for double the number of pages and that suits our needs for now 👍

midhunpm commented 5 years ago

@mansona - The application is not production ready yet but we are thinking about running build every night to pre-render the pages as we might have changes in the content that we display in the pages.