Mark Ku's Blog

Hands-On SEO Part 3 - Rendertron, Google's Dynamic Rendering Tool for SEO

Background

Modern dynamic websites rely heavily on JavaScript and Ajax-based technologies, but these are not particularly friendly to Google's search crawler. According to Google's official documentation, the crawler understands HTML structures very well, but still has trouble crawling JavaScript and Ajax. To improve crawler-friendliness, Google still recommends serving content as HTML.

[Previous article]

What is Rendertron

Rendertron is a project developed by the Google Chrome team using Node.js and Puppeteer. It can be used to solve any dynamic website content that search engines cannot crawl. However, advanced scenarios such as virtual lists, lazy loading, and more granular browser interactions are not supported out of the box, but the source code is open and quite easy to modify, so you can extend it yourself.

[Reference] [GitHub]

How Rendertron Works

The web server inspects the search engine bot's user agent and forwards the request to your self-hosted Rendertron server. Rendertron then either serves a cached page or fires up Puppeteer to crawl the page on demand.

Simulate a Google bot visiting your site

https://render-tron.appspot.com/render/your-site
https://render-tron.appspot.com/render/https://www.letgo.com.tw/

Enter the URL you want to render

Rendertron web interface with URL input and rendering options
Rendertron web interface with URL input and rendering options

The rendered page is returned to the client

Rendertron rendering a website displaying a Coming Soon pop-up
Rendertron rendering a website displaying a Coming Soon pop-up

Next, download and start the Rendertron service

// Clone the source
git clone https://github.com/GoogleChrome/rendertron.git
// Install dependencies
npm install
// Build
npm run build
// Run the service
npm run start

Configure Nginx to forward common search engine bot requests to the Rendertron host

location / {
    try_files $uri @prerender;
}
location @prerender {
    set $prerender 0;
    if ($http_user_agent ~* "googlebot|yahoo|bingbot|baiduspider|yandex|yeti|yodaobot|gigabot|ia_archiver|facebookexternalhit|twitterbot|developers\.google\.com") {
        set $prerender 1;
    }
    if ($args ~ "_escaped_fragment_|prerender=1") {
        set $prerender 1;
    }
    if ($http_user_agent ~ "Prerender") {
        set $prerender 0;
    }
    if ($prerender = 1) {
        rewrite .* /render/$scheme://$host$request_uri? break;
        proxy_pass http://localhost:3000; #You can use our own hosted Rendertron
    }
    if ($prerender = 0) {
        rewrite .* /index.html break;
    }
}

Author

Mark Ku

擁有 10+ 年經驗的資深軟體工程師,現為 AI 應用 Builder,專注於大型平台架構與簡化複雜系統設計,從電商系統到訂閱與收費平台,結合 AI Agent、AI 整合與自動化開發,打造高效率且可持續演進的產品技術基礎。Read More

Found this useful?

The author's free tools, daily podcasts and newsletter are all here.

Mark Ku · This article is licensed under CC BY 4.0. Credit the author and link back to the original when reusing it.

Comments

Subscribe to Newsletter

Subscribe to get new posts delivered instantly — never miss a tech share.

By submitting, you agree to receive emails. You can anytime.

Popular Posts

View all
Mark Ku
··602

Oracle Cloud Always Free Tier: Linux Host and Static IP for a $0 Cloud Solution

Oracle Cloud Always Free Tier: Linux Host and Static IP for a $0 Cloud Solution
Mark Ku
··490

Say Goodbye to Postman's Fee Trap! A Hands-on Guide to Bruno, the Open-Source Git-Native API Testing Powerhouse.

Say Goodbye to Postman's Fee Trap! A Hands-on Guide to Bruno, the Open-Source Git-Native API Testing Powerhouse.
Mark Ku
··333

A Free, Open-Source, Notion-like Knowledge Base — A Complete Guide to Deploying and Backing Up Outline Wiki

A Free, Open-Source, Notion-like Knowledge Base — A Complete Guide to Deploying and Backing Up Outline Wiki
Mark Ku
··264

Training Your Own AI Voice: Hardware Requirements, Open-Source Model Comparison, and LoRA Fine-Tuning

Training Your Own AI Voice: Hardware Requirements, Open-Source Model Comparison, and LoRA Fine-Tuning
Mark Ku
··221

Building an Efficient API Management Platform: Deploying Kong Gateway from Scratch - Part 1

Building an Efficient API Management Platform: Deploying Kong Gateway from Scratch - Part 1
Mark Ku
··215

Setting Up Samba on Ubuntu to Share Folders with Windows 11

Setting Up Samba on Ubuntu to Share Folders with Windows 11