By reducing the file size by removing all the white space, replacing long variable and function names with shorter ones and removing unnecessary characters, you can typically reduce most files in some way
3. Serve them compressed using HTTP compression
Serving the files using HTTP compression will further reduce the payload downloaded from the server and ensure that you’re getting a speedy site!
4. Put them at the bottom of the page (just before the closing body tag)
This is to prevent them from blocking the downloading and rendering of other assets so that your site can display as fast as possible.
5. Replace Libraries with Custom Code
Only really practical if your only using a specific subset of functionality from a specific library. If all your doing is DOM traversal with jQuery, do you really need the full jQuery library? Could you re-factor your JS code to use document.getElementById(‘nodeId’) and document. getElementsByClassName() instead and drop the library dependency entirely?
There are no comments currently for this post!