Giter VIP home page Giter VIP logo

Comments (3)

ProjectCleverWeb avatar ProjectCleverWeb commented on June 19, 2024

Scripts loaded in the head are downloaded asynchronously of each other before the page loads, while scripts in the footer are downloaded in sequence after the rest of the page is loaded. The difference is that when you load in the head, your net page load time is faster.

The only good time to load scripts in the footer, is when you have a very JavaScript heavy website, and loading in footer makes the page appear noticeably faster. (I would say at least 250ms faster)

Otherwise, it makes more sense to load them in the head. In this case, most servers will serve the files up fast enough that you won't be able to tell the difference.


P.S.

You can cut about 200 or so milliseconds off page load time by combining all the JS files into one and just serving that 1 file. This is due to the protocol for the server & client connection. You can achieve a similar effect without combining files by implementing SPDY

from semantic-ui-wordpress.

garybrowne avatar garybrowne commented on June 19, 2024

Thanks Nicholas!

from semantic-ui-wordpress.

ProjectCleverWeb avatar ProjectCleverWeb commented on June 19, 2024

No problem, and glad I could help 😃

Also, to extend my note on combining files and then serving them. The amount of the decrease in page load time varies from server-to-server, and is largely dependent on how Apache/PHP is configured to work on the system and where the server is located. For example, on a slower configuration, this may save you 400ms and on a faster and distributed system this may only save you 100ms.

from semantic-ui-wordpress.

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.