ssr-prerender is a wrapper to use Prerender to prerender HTML for SEO. It can run with docker.
309
ssr-prerender is a wrapper to use Prerender to prerender HTML for SEO. It can run by Docker Compose, Docker or Docker Compose or Shell(Traditional).
Prerender is a node server that uses Headless Chrome to render HTML, screenshots, PDFs, and HAR files out of any web page. The Prerender server listens for an http request, takes the URL and loads it in Headless Chrome, waits for the page to finish loading by waiting for the network to be idle, and then returns your content.
It have some advantages:
Loosely coupled No code or only a small codes need to modify no matter what technical architecture is used within Front-End or Back-End.
Out of the box Provide cache support, multiple render types(HTML, Image, PDF, HAR), Allowlist, Blacklist, etc.

Powered by PlantUML
Google Chrome It is optional while run within the docker container.
You can change configuration within .env file.
# prerender/prerender: Node server that uses Headless Chrome to render a javascript-rendered page as HTML. To be used in conjunction with prerender middleware.
# https://github.com/prerender/prerende
CHROME_FLAGS="--no-sandbox, --headless, --disable-gpu, --remote-debugging-port=9222, --hide-scrollbars"
LOG_REQUESTS=false
PORT=3000
# memory or redis
STORAGE_CACHE=memory
# prerender-redis-cache/prerenderRedisCache.js at master · JonathanBennett/prerender-redis-cache
# https://github.com/JonathanBennett/prerender-redis-cache/blob/master/lib/prerenderRedisCache.js
# REDISTOGO_URL=redis://redis:6379/0
# REDISCLOUD_URL=redis://redis:6379/0
# REDISGREEN_URL=redis://redis:6379/0
REDIS_URL=redis://redis:6379/0
# prerender/prerender-memory-cache: In memory cache for use with Prerender server
# https://github.com/prerender/prerender-memory-cache
CACHE_MAXSIZE=10000
CACHE_TTL=3600
Recommand to run ss-prerender with Docker Compose or Docker.
docker-compose up
docker run -it --rm --name ssr-prerender -p 3000:3000 cloudolife/ssr-prerender:latest
TBD
You can run ss-prerender from local shell or within a docker container.
node server.js
That's all.
http://localhost:3000/http://localhost:8080
This repository has provider a Google Chrome version and will auto install while docker build process. But you can upgrade Google Chrome to the latest version by download and replace google-chrome-stable_current_amd64.deb file with the latest Google Chrome version.
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O google-chrome-stable_current_amd64.deb
Then, run command docker build . or docker-compose buiid to rebuild it.
[2] Prerender - Dynamic Rendering for Effective JavaScript SEO | Prerender - https://prerender.io/
[5] Prerender.com | Documentation - https://prerender.com/documentation
Content type
Image
Digest
sha256:d6168563a…
Size
686.5 MB
Last updated
almost 4 years ago
docker pull cloudolife/ssr-prerender