I am currently trying to improve my website’s SEO ranking.
I am using meteor with react and mongodb with flow-router.
What am i trying to achieve?
I am trying to dynamically change the title and keywords tag <meta name="title" content="Meteor Rocks"/> <meta name="keywords" content="meteor, react, mongodb">
I tried to use react-helmet, which seems to change the virtual-dom title but the main source (view-source) remains the same.
You could try using prerender. Pretty easy to set up, all you need is the main prerender package and prerender-node. I’m not at my computer now but I could give you a basic config in the morning!
I could be wrong, but isn’t that package for actual SSR rather than delivering a static HTML file for bots / crawlers? Personally, I don’t want SSR because of the CPU overhead.
It seems that prerender is a middleware that query a third party server, get back and HTML and then return it to the client.
I’ve no experience using it, but it might be an overkill here. If you just want to change the keyword tags, appendToHead in the sink object can be used. The react helmet does it after the page has been loaded.
Ah! I didn’t know it’s open source and can be self hosted.
So essentially you’re running a microservice that render client pages and cache the generated html content, the cached content will then get delivered to the bot/crawlers when they hit the page,
Currently prerender uses 0% cpu and 40mb of memory on my test server (a $5/pm digitalocean droplet) and that’s with a slightly more complicated config to the one I shared above.
If SSR is proving problematic or intensive, prerender is a good way to offload the app onto your client while maintaining good SEO and crawlability
Zero direct experience here, but I would think that prerender would deliver a faster page load to the bot, as well - since Google & friends now consider load time strongly in page rankings, this would seem to be another benefit vs. SSR.