TimeoutError with Puppeteer + CloudFlare CDN

I have implemented a prerender application using Puppeteer and Express. I use this application to generate preview in facebook and whatsapp mainly. My web app uses vue.js framework with service worker enabled.

This works fine if I disabled caching (DNS Only). My prerender application successfully renders the page and return the html in couple of seconds. But if I turned on caching, prerender application throws TimeoutError. Issue is happening with page.goto() method. I have tried all the waitUntil options, but no luck. Interesting part is, if I request for the same URL for the second time, it will render correctly. First request will always fail if caching is turned on in CloudFlare.

I have tried adding IP Access Rule to whitelist my prerendering machine IP address. Also tried adding Firewall rule to “Allow” puppeteer user agent. Nothing helped. :frowning:

It will be really helpful if someone could point out what might be the reason for this issue.

This topic was automatically closed after 14 days. New replies are no longer allowed.