2 ms·
Nonsense. You have the css and javascripts. You just aren't certain that they're the most recent version. So you go ahead and render the page using either the v
by eloff 11y ago
Nonsense. You have the css and javascripts. You just aren't certain that they're the most recent version. So you go ahead and render the page using either the version you have, or requesting it from the server, still doing everything in order. Then you validate your assumptions in the background about the stale versions you used still being the most current. If your assumptions are right (and mostly they will be) nothing happens. If they're wrong, you re-render the page, again all in order.
- deleted 11y ago[deleted]
- jasonkester 11y agoSense. It makes a difference if you run an old javascript file before loading its new replacement and running that. As in, Original script: <script> location.href="http://google.com"; </script> New script <script> // oops! forgot to remove this // location.href="http://google.com"; </script> You'll want to make sure you have the right version in place before you try to run either of them.
- eloff 11y agoYou have a point. What about CSS? At first I think it would just render funny, but some javascript actually interacts with the CSS, e.g. jQuery selectors based on style classes or something. So it has the same problem really. Images would be safe. Or an alternate plan, start rendering, but do not run the javascript until the resource checks for css+js files return. It would slow things down some more, but not as much as waiting for everything.
- jasonkester 11y agoBefore: body { background:blue; } After: body {} It would play out similar to the Flash of Unstyled Content issue, but substituting "unpredictably wacky" for "unstyled".