How to test your prerendered pages with the new Chrome engine
Many users of Galaxy take advantage of the built-in Prerender service to enable their JavaScript clients to be crawled by search engines. Prerender automatically renders and caches JavaScript apps and websites on Galaxy using an in-memory browser, and Galaxy returns those cached renderings when asked by a crawler.
Prerender currently uses a rendering engine based on PhantomJS. However, some of our users have reported that Prerender doesn’t work with their site — primarily due to PhantomJS’s lack of support for ES6 output. Luckily, our friends at Prerender have built a new rendering engine based on Chrome.
At the end of this month, we’ll upgrade all Galaxy apps to use the new Chrome rendering engine. Apps will gain this new ability automatically, with no additional action needed from users.
As with any major platform change, users should expect potential differences in the way Chrome renders their pages. For most apps, upgrading to Chrome should improve rendering speed and compatibility. But that might not be the case for all users. That’s why we’ve made it possible for Galaxy users to test how their app will render with the new engine, and choose to opt out of this engine on a per-app basis.
Testing your prerendered pages
In order to see how your app looks prerendered with the Chrome engine, use the following incantation. (Yes, it really is a single URL that looks like two different URLs smooshed together without a space before your URL’s “https”.)
curl -H 'x-prerender-browser: chrome' https://service.prerender.io/https://www.yoursite.com
To see the result from PhantomJS, do not pass the x-prerender-browser header.
Opting out of Chrome in Prerender
In the unlikely case that you need to remain with PhantomJS, the only option is to create your own Prerender account, obtain a token, and supply it in your application’s settings.json according to the Galaxy SEO package like this:
{
"PrerenderIO": {
"token": "yourtoken"
"serviceUrl": "https://service.prerender.io"
}
}
Note that because the default setting in the prerender npm module uses http for serviceUrl, we recommend you enforce https by supplying the serviceUrl as above.
That said, we wouldn’t be surprised if Prerender eventually switches everybody over to Chrome, so if your app only works in PhantomJS we encourage you to contact the super responsive support folks at Prerender (support@prerender.io) to let them know.
We are pleased to bring these new abilities to your Galaxy apps, and hope the Chrome integration brings you many fast and fruitful renderings!
Galaxy’s Prerender service is upgrading to Chrome! was originally published in Meteor Blog on Medium, where people are continuing the conversation by highlighting and responding to this story.