« Blog Home

§ Even Faster Webpages

A couple of things to make pages a little faster than what I wrote in Faster webpages.

First off, I categorically stated that JavaScript needed to go in the head element of the page, even if it did seem to work placed at the bottom of the body.  At the time, that's what the rules required, but now it is proper to place it at the end of the body.

Another thing that can help is headjs.com.  It allows you to easily load additional JavaScript or CSS after the page onload event.  For example:

head.load("jquery.min.js", function() {
  //code here runs after jQuery is loaded and ready
  head.load("colorbox.js", function() {
    //here colorbox is finished loading
    $(".colorbox").colorbox();
  });
});

headjs can also check for supported browser features so you can decide which bells and whistles to include.

I mentioned compression in the earlier post, but pages can also be compressed in advance rather than having the server do it when needed:  kevinlocke.name/bits/2016/01/20/serving-pre-compressed-files-with-apache-multiviews/

I'm working on this for the next site update, so more later.

last edited on September 5th, 2017 at 9:59 PM

Comments

No Comments Here. Add yours below!

Add your comment

Name:
Email: (Will not be displayed - Privacy policy)
Website:
Comments:
  random image I can't read it!
Give me a different one!
Verify Post: Input the text from the image above to verify this post (helps prevent spam)
 

« Blog Home


“You make me feel like some kind’a space suit or somethin’,” Molly responded sorrowfully.
Molly, Run to Chaos Keep, Jack L. Chalker