File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ This project provides a **Dockerized prerender service** based on `prerender` wi
2828| ` PORT ` | ` 3000 ` | Port the service listens on |
2929| ` CACHE_MAXSIZE ` | ` 1000 ` | Maximum number of cached entries |
3030| ` CACHE_TTL ` | ` 43200 ` | Cache lifetime in seconds (12 hour) |
31+ | ` WAIT_AFTER_LAST_REQUEST ` | ` 200 ` | Wait time (ms) after last network request before rendering |
3132
3233---
3334
@@ -84,6 +85,8 @@ services:
8485 - CACHE_MAXSIZE=1000
8586 # Cache duration in seconds (43200s = 12 hours)
8687 - CACHE_TTL=43200
88+ # Wait time in ms after last network request before rendering
89+ - WAIT_AFTER_LAST_REQUEST=200
8790
8891```
8992
Original file line number Diff line number Diff line change @@ -20,16 +20,18 @@ const server = prerender({
2020 '--disable-software-rasterizer' ,
2121 '--metrics-recording-only' ,
2222 '--no-first-run' ,
23- '--safebrowsing-disable-auto-update'
23+ '--safebrowsing-disable-auto-update' ,
24+ '--blink-settings=imagesEnabled=false'
2425 ] ,
2526 pageLoadTimeout : 20000 ,
26- waitAfterLastRequest : 1500 ,
27- pageDoneCheckInterval : 300 ,
27+ waitAfterLastRequest : parseInt ( process . env . WAIT_AFTER_LAST_REQUEST , 10 ) || 200 ,
28+ pageDoneCheckInterval : 50 ,
2829 chromeRefreshRate : 100
2930} ) ;
3031
3132process . env . CACHE_MAXSIZE = process . env . CACHE_MAXSIZE || 1000 ;
3233process . env . CACHE_TTL = process . env . CACHE_TTL || 43200 ;
34+ process . env . WAIT_AFTER_LAST_REQUEST = process . env . WAIT_AFTER_LAST_REQUEST || 200 ;
3335
3436// Block requests that typically hang and prevent page from finishing
3537const BLOCKED_PATTERNS = [
You can’t perform that action at this time.
0 commit comments