+0
日增长
5,949
stars
895
forks
4
watchers
706
prs
280
issues
2
releases
README
Rendertron Rendertron is deprecated Please note that this project is deprecated. Dynamic rendering is not a recommended approach and there are better approaches to rendering on the web. Rendertron will not be actively maintained at this point. Rendertron is a headless Chrome rendering solution designed to render & serialise web pages on the fly. :hammer: Built with Puppeteer :cloud: Easy deployment to Google Cloud :mag: Improves SEO Rendertron is designed to enable your Progressive Web App (PWA) to serve the correct content to any bot that doesn't render or execute JavaScript. Rendertron runs as a standalone HTTP server. Rendertron renders requested pages using Headless Chrome, auto-detecting when your PWA has completed loading and serializes the response back to the original request. To use Rendertron, your application configures middleware to determine whether to proxy a request to Rendertron. Rendertron is compatible with all client side technologies, including web components. Contents - Middleware - API - Render - Screenshot - Invalidate cache - FAQ - Query parameters - Page render timing - Rendering budget timeout - Web components - Status codes - Installing & deploying - Building - Running locally - Deploying to Google Cloud Platform - Deploying using Docker - Config - Troubleshooting Middleware Once you have the service up and running, you'll need to implement the differential serving layer. This checks the user agent to determine whether prerendering is required. This is a list of middleware available to use with the Rendertron service: - Express.js middleware - Firebase functions (Community maintained) - ASP.net core middleware (Community maintained) - Python (Django) middleware and decorator (Community maintained) Rendertron is also compatible with prerender.io middleware. Note: the user agent lists differ there. API Render GET /render/ The render endpoint will render your page and serialize your page. Options are specified as query parameters: - mobile defaults to false. Enable by passing ?mobile to request the mobile version of your site. - refreshCache: Pass refreshCache=true to ignore potentially cached render results and treat the request as if it is not cached yet. The new render result is used to replace the previous result. Screenshot GET /screenshot/ POST /screenshot/ The screenshot endpoint can be used to verify that your page is rendering correctly. Both endpoints support the following query parameters: - width defaults to 1000 - specifies viewport width. - height defaults to 1000 - specifies viewport height. - mobile defaults to false. Enable by passing ?mobile to request the mobile version of your site. - timezoneId - specifies rendering for timezone. Additional options are available as a JSON string in the POST body. See Puppeteer documentation for available options. You cannot specify the type (defaults to jpeg) and encoding (defaults to binar
Latest release
3.1.0 3.1.0 2020-11-04This release contains a security patch! Security improvements Prevents rendering of .internal URLs, patching an issue with GCE. Adds allow-listing option to restrict rendering to a given list of domains or URL patterns. Features Include Heroku deploy documentation and an interactive "Click to deploy" for Heroku Introduces an API endpoint to clear all cache Adds timezone support Adds optional forced browser restart between renders Adds documentation to deploy Rendertron via Docker Adds option to add request headers to the rendered pages in Rendertron Improvements F