Disclaimer:
These pages about different languages / apis / best practices were mostly jotted down quckily and rarely corrected afterwards.
The languages / apis / best practices may have changed over time (e.g. the facebook api being a prime example), so what was documented as a good way to do something at the time might be outdated when you read it (some pages here are over 15 years old).
Just as a reminder.

Decrease the loading time for web pages

how to reduce number of http requests


I am working on a personal project since some time, and naturally wanting it to load as fast as possible, one thing that greatly improves the speed is to try to keep the http requests down.

As a side note, to "build" my website I use ant, (in essence, pack together and push out the files I changed to the production server), so that is what i refer to when i mention "build process" further ahead.

Less files, means less requests.

I bundle together all css files in the build process, i.e. it means the client would only have to request one css instead of several in parallel.
Analogue for the javascript files.

On the bundled javascript file I use yuicompressor, since it makes the file smaller than minify.
However, yuicompressor does not make the css file as small as minify, so for the bundled css I use minify.

The advantage of having it in the build process, is that I can edit away in different css/javascript files as normal and dont have to think
about bundling them together and minifying it afterwards.

Common javascripts, for example jquery, is not much point in hosting yourself, better link to the cdns, it reduces the number of parallel requests to your server.

Flush at least after the HEAD-tag, so the browser can start loading css/javascript files. It might make sense to show your header / menu etc and flush after that,
so if the user just passing through and wants to click onto some other page in your menu, they can do it quickly.
but put up some text "Page is loading..." or something, so the user do not think that the page was faulty loaded.

If the javascripts are not immedieately needed, try put them at the BOTTOM of the page, that will prevent the javascript src from taken up request space from for example css or images.

Use css sprites; bundle images together into one image (hence only one http request to fetch several images), and display different parts
of that image using the css background-image /position.

Memcache anything that makes sense, keep in mind that you can also cache chunks of html to avoid recalculating stuff (it is not just db-requests that slow things down),
but make sure you have proper handling of the data with/without memcache.
A good test is to bring memcache down and the web page should still look nice.

Turn on gzip on anything that makes sense (e.g. not useful for pdf, but for ccs and js)

But getting a bit off topic, just wanted to mention the number of http requests which people tend to forget about.
Google around and you will find other tips on how to speed up your website.


More programming related pages

Workflow: Release process
Workflow: Bug tracking
Teambox (Redbooth) - Mantis connector
Design Patterns
Git & Github
Go / Golang
CVS
CVS backup script
Distribution process
Installation script
Java Server Faces
Facelets
jibx
jBoss
jBpm
Perl tips
Perl links
PostgreSQL
Python / py2app
Shell scripts
Xslt
Node.js
Facebook / Opengraph
PHP developer notes
Redbooth API through php
Website optimization
jqTableKit demo
Javascript / html / css links