Skip to content

Comment on Poor Man's Scalabilityparent

Comments

If you really do have a legitimate 1500 msec process occurring on the home page, try to flush as much of the HTML to the browser before you start the heavy lifting. Ideally, you could have the entire HTML shell delivered immediately, and the content elements slotted in at the very end (using DOM manipulation).

If you can put all the content inside a <script/> tag at the very end of the HTML, it will at least give the browser a chance to find and download all the page's resources (css, Jquery, logo image, etc etc).

e.g.

  <html>
  <head><link rel="stylesheet"></head>
  <body>
    <h1>Home Page</h1>
    <p id="content1">cheap content</p>
    <p id="content2">place-holder content</p>
    <p id="content3">more content</p>
  ~~flush~~
    <script>
    $("#content2").html("expensive content");
    </script>
  </body>
  </html>
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.