I’m using prerender.io to serve the “application/JS” version of the site to crawlers ( my instance serves crawlers the JS version via a hidden setting )
It’s working well but seems discourse might fall under this category …
but some web pages use some custom loading flows or constant polling that may trick Prerender’s logic; thus, it fails to make a decision on the ready-ness of the page.
The first time prerender accesses any discourse URL, it will timeout ( 20 seconds set by prerender )
The page renders fine it’s just that prerender.io doesn’t know the page is fully loaded so it “stays” trying to render the page, till the 20 seconds is up, then it serves the HTML version
If the crawler requests the page again, it will serve the page in 1 second (give or take) - as there’s an HTML version of the URL in the cache
…but thats not practical as there are thousands of URLS and 20 seconds for each URL ( for the first time its accessed) will not work
So I will need the below added right after the <head>
tag (and when the page is done to set the variable to true
)
<script> window.prerenderReady = false; </script>
https://docs.prerender.io/docs/25-empty-or-partially-rendered-pages
I’d like this to work site-wide- hopefully, that makes the job easier
Not sure what this entails but if I’m off please let me know - $300? $400?