This site loads so quickly. What is your secret?
PrevNode LinkNextFirst of all, note that I do not consider myself an expert on load time optimisations, and you may be able to find better advice elsewhere using web searches.
That put aside, here are some factors that may contribute to this:
Some of it has to do with my web hosting, currently HostGator. While not perfect, I am quite happy with them, and can recommend them for shared hosting.
It is possible the site does not receive a lot of traffic for a variety of reasons. (I'm not sure.)
The website is mostly static and served from the server's hard disk directly without potentially costly server-side scripting.
I avoid loading unnecessary JavaScript codes and other resources from other sites (with some possible exceptions.).
I enabled server-side gzip/deflate/etc. compression.
XHTML/HTML, CSS, and JavaScript are all being minified. See HTML minifier for HTML, Go minifiers for SVG, and UglifyJS for JavaScript.
I use common external stylesheets, script files, and images, instead of embedding them on every page.
PNG images are compressed using OptiPNG ; SVG images are used as well.
Moreover, I recently started to increasingly make use of the WebP format, whose files tend to be smaller than PNG and JPEG ones, and look better and crispier than JPEG.
I sometimes remove various embellishments of the site, that, while seemed a good idea, or even were one in the past, are no longer needed.
The navigation menu is partly populated after the page load by using an XMLHttpRequest (or so-called "AJAX") call to a static JSON file.
I sometimes reduce the size of the HTML markup by using wrapper tags and child or descendent CSS combinators. Moreover, adding CSS classes or
id="…"
attributes to existing tags can help even more.I use webpack to remaster jQuery-UI’s distribution, and reduce its size.
Are all these techniques useful on each-and-every WWW request? Probably not. Someone told me many pages of my site do not have too many images, whether .webp or otherwise. ( Reference . ) But I still prefer to leave no stone unturned and not rest-on-my-laurels. ( Reference: “Factor Optimisations” )
Some constraints may play against the site's responsiveness. For example:
Use of XHTML instead of HTML.
Use of valid markup.
Use of jQuery and jQuery-UI. I see them as desirable Evils out of convenience.
My policy for my sites to be as usable as possible with JavaScript/etc. unavailable.
Also see:
Wired feature about the average web page size:
The Average Webpage Is Now the Size of the Original Doom | WIRED
.