Server-Side Rendering
Server-side rendering allows the content of your PWA store to be available for the search engine and social network bots.
SSR (Server-Side Rendering) provides the content of your PWA store to the search engine and social network bots for the best indexing and display.
ReadyMage instances come with a Rendy.JS module pre-installed. You can connect through the User Portal.

Connecting to the ReadyMage account
Navigate to User Portal → Project → Selected Instance → Service Management → Server-Side Rendering.
Click Connect.
Redeploy your instance.
Disconnecting your Rendy.JS account
Navigate to User Portal → Instances → Service Management → Server-Side Rendering.
Click Disconnect.
Redeploy your instance.
Rendy.JS Implementation
To allow Rendy.JS to process bot traffic, ReadyMage infrastructure has the following snippet added to the front-facing Nginx (cache router):
server {
...
# Main application entrypoint
location / {
set $rendy_token "";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Rendy-Token $rendy_token;
set $rendy 0;
if ($http_user_agent ~*
"googlebot|bingbot|yandex|baiduspider|twitterbot|facebookexternalhit|rog
erbot|linkedinbot|embedly|quora link
preview|showyoubot|outbrain|pinterest\/0\.
|pinterestbot|slackbot|vkShare|W3C_Validator|whatsapp|AhrefsBot,
scandibot") {
set $rendy 1;
}
if ($args ~ "_escaped_fragment_") {
set $rendy 1;
}
if ($http_user_agent ~ "rendyjs") {
set $rendy 0;
}
if ($uri ~* "\.
(js|css|xml|less|png|jpg|jpeg|webp|gif|pdf|doc|txt|ico|rss|zip|mp3|rar|e
xe|wmv|doc|avi|ppt|mpg|mpeg|tif|wav|mov|psd|ai|xls|mp4|m4a|swf|dat|dmg|i
so|flv|m4v|torrent|ttf|woff|svg|eot)") {
set $rendy 0;
}
# We want to always skip requests to Rendy.JS if there are
query arguments. This reduces number of unique urls and keeps the costs
down.
if ($is_args) {
set $rendy 0;
}
if ($rendy = 1) {
set $rendy_token "inserttoken";
set $rendyjs_address "prerender.rendyjs.com";
rewrite .* /?url=https://$host$request_uri? break;
proxy_pass http://$rendyjs_address;
}
proxy_pass http://varnish:80;
}
...
}
Last updated
Was this helpful?