gitmyhub

rendertron

TypeScript ★ 6.0k updated 3y ago ▣ archived

A Headless Chrome rendering solution

Rendertron is a server that runs a copy of Chrome in headless mode (meaning the browser runs in the background without any visible window) to load web pages and capture their fully-rendered HTML. It was built by the Google Chrome team. The README states clearly that this project is deprecated and will no longer be actively maintained.

The problem Rendertron was designed to solve involves web apps built with JavaScript that load their content dynamically in the browser. Search engine crawlers and some social media bots do not always run JavaScript, so they see an empty page instead of the actual content. Rendertron solved this by sitting between those bots and your web server, loading the page in a real browser, waiting for all the JavaScript to finish, and then returning the fully built HTML to the crawler.

It works as a standalone HTTP server. Your own web server sends requests to Rendertron when it detects a bot based on the user-agent string. Rendertron loads the requested page, detects when the page has finished loading (watching for network activity to settle and a load event to fire), and sends back the serialized HTML. It also supports taking screenshots of pages and caches rendered results to avoid re-rendering the same page repeatedly.

The tool can be installed as an npm package and run locally, or deployed to Google Cloud Platform. Configuration is done through a JSON file covering settings like timeout, port, and screen dimensions. Middleware packages exist for Express.js, Django, and ASP.NET Core to handle the bot-detection routing step on the server side.

The README explicitly notes that dynamic rendering is no longer a recommended approach for SEO, and Google's own guidance has moved toward server-side rendering or static generation instead. This repository exists as a reference but should not be chosen for new projects.