How to speed up page load

This is probably one of the most frequently asked non-data structure questions in my interviews. My answers are:

  • DNS speed. Depending on who is hosting the DNS for you, there might be speed implications. The famous one is, GoDaddy’s DNS server is sometimes unreachable inside China. So, if you want to serve the Chinese market, maybe you should think about DNSPod.
  • Gzip the traffic. Most web servers and browsers support compression such as gzip. Read more on this article
  • Size of the
    • HTML, reduce unecessary markups
    • CSS, minify, uglify
    • JS, minify, uglify
    • Images, compression, trying to serve different sizes for mobile website
  • Number of HTTP requests
    • CSS, combining all into one file
    • JS, combining all into one file
    • Images, CSSsprite, combining many small images into one
  • Cacheing
    • Set expiration headers for all assets, and let them expire way in the future
    • If anything needs to be changed, change the url of the assets. I.e. changing from adfafa.css to adfjileafs.css

Anything else I am missing? A good article to read: