3 ms·
We've faced this problem when we were deploying our Meteor application. The issue in particular was mostly for crawlability purposes and Twitter/Facebook metada
by pmalynin 11y ago
We've faced this problem when we were deploying our Meteor application. The issue in particular was mostly for crawlability purposes and Twitter/Facebook metadata. The first issue (crawlability) -- which, of course, directly impacts users who cannot run javascript such as search engines [1] -- can be solved trivially by sticking phantomjs in front and redirecting server-side depending on UA. Combined with NGINX's caching you can then serve these rendered pages without needing to hit phantomjs every single time. The nice thing is, if you don't prune the "script" tags from the rendered pages, you can then just serve these cached pages back to the user. The HTML will be rendered, then if you have JS enabled the Meteor (React | Angular | JSFrameworkOfChoice) it will just re-render the page.
[1] I am aware that Google now can run JavaScript, but I've found it to be rather bad and to mangle my pages in quite horrible ways.