Coder Social home page Coder Social logo

Comments (22)

thoop avatar thoop commented on June 18, 2024

Are you setting window.prerenderReady = false; in your javascript? Or on the initial page that comes back from the server in a <script> tag?

How long do your pages take to load? It could be that we're hitting a timeout and just saving the HTML because we assume that you might have forgotten to set window.prerenderReady = true;

from prerender.

lukezheng avatar lukezheng commented on June 18, 2024

I tried setting window.prerenderReady = false; in my javascript and in my initial page that comes back from the server in a <script> tag.

My page loads in about 500ms-1sec max.

from prerender.

thoop avatar thoop commented on June 18, 2024

Can you email me some of your URLs so I can test them and make sure phantomjs isn't having any problems? [email protected]

Thanks!

from prerender.

lukezheng avatar lukezheng commented on June 18, 2024

Cool, sent! Thanks Todd. Let me know how I can help!

from prerender.

patricklehmann avatar patricklehmann commented on June 18, 2024

Hey, same issue in here! I just sent you a mail with the link. thanks for watching!

from prerender.

Sija avatar Sija commented on June 18, 2024

Same here! window.prerenderReady = false is being set inline in script tag inside <head> section.
Then I set it to true after first dispatcher:dispatch event, triggered by Chaplin.mediator.
I'm using Chaplin.js (Backbone based) with RequireJS (and almond compiler).

from prerender.

thoop avatar thoop commented on June 18, 2024

That should be fine. Do you mind sending me an email with some of your URLs so I can debug them? [email protected]

from prerender.

lukezheng avatar lukezheng commented on June 18, 2024

Looks like it's no longer an issue for me. I didn't actually find out the root cause of the issue since I just got rid of the page that had problems.

from prerender.

stewones avatar stewones commented on June 18, 2024

+1 same here. email sent @thoop
hope you can help. thx.

from prerender.

gytisgreitai avatar gytisgreitai commented on June 18, 2024

I would like to clarify one thing. From the documentation:

When we see window.prerenderReady set to false, we'll wait until it's set to true to save the HTML.

though looking at prerender source code, it seems that prerender waits for all requests to finish, and only then starts checking if prerenderReady is set to true.

Am i correct?

from prerender.

thoop avatar thoop commented on June 18, 2024

Correct. We only use window.prerenderReady as a signal to tell us to wait longer than usual and you cannot use it to make us save the page earlier than we normally would. This might change in the future to make it work both ways but that's how it currently works.

from prerender.

samvloeberghs avatar samvloeberghs commented on June 18, 2024

@thoop just to check, has the behaviour you described in your latest comment been implemented in any way or not?

from prerender.

thoop avatar thoop commented on June 18, 2024

window.prerenderReady is still just a signal to tell us to wait longer and is used in combination with waiting for all ajax calls to complete. We do not currently have a way to force the page to complete before all ajax calls are complete. Sorry for the inconvenience!

from prerender.

ccqgithub avatar ccqgithub commented on June 18, 2024

i found this issue is closed!

is this issue fixed? or it will be fixed ?
if i set pageDoneCheckTimeout much large, and window.prerenderReady = true;, the page wait for Infinite (pageDoneCheckTimeout) .

how can i do with the problem ???

from prerender.

thoop avatar thoop commented on June 18, 2024

If you set pageDoneCheckTimeout to a very large number then of course the page won't complete because you are never executing the check to see if the page is done loading. window.prerenderReady is working as expected.

from prerender.

dingyuliang avatar dingyuliang commented on June 18, 2024

@ccqgithub, I have built a project which is to solve AJAX call & Timeout in both jQuery & AngularJS.
It may be helpful for you.
Please see https://github.com/dingyuliang/prerenderready-javascript

from prerender.

dingyuliang avatar dingyuliang commented on June 18, 2024

from prerender.

thoop avatar thoop commented on June 18, 2024

Cool! The Prerender server already counts all requests in flight (all requests, not just ajax) and then saves the page a short time after that number reaches zero. So counting all ajax calls in the javascript as well might be a little overboard.

from prerender.

dingyuliang avatar dingyuliang commented on June 18, 2024

Thank you very much.
When I was testing last month, I hosted Prerender.io service on my local, it didn't do like this.
I will test this later.

I agree if Prerender Server already does this, we don't this any JavaScript level logic.

from prerender.

ansaries avatar ansaries commented on June 18, 2024

hi @thoop,
I am working on a Meteorjs project where the server calls are mostly through websockets instead of ajax/http.
I am seeing that some of my pages are rendering properly and some are cached before the window.prerenderReady is set to true

please review http://foctest.meteorapp.com/service/Helper-or-Maid/Dubai?_escaped_fragment_= (not rendered and cached properly)

http://foctest.meteorapp.com/service/Furniture-Assembly/Dubai?_escaped_fragment_= (is working fine, same route)

also review http://foctest.meteorapp.com/p/auntest130?_escaped_fragment_= (which takes more time yet is rendered properly)

from prerender.

thoop avatar thoop commented on June 18, 2024

@ansaries Looks like it's rendering correctly when I test it against our service directly, so it looks like that could have been a timing issue where the page took too long to load. Try recaching that page and see if it looks better. If so, then you'll want to make sure your pages are loading correctly before they timeout.

from prerender.

thoop avatar thoop commented on June 18, 2024

Locking this conversation as it's become a dumping ground for issues. Please create a new issue or email us at [email protected]. Thanks!

from prerender.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.