These are some lessons in web development I learned the hard way. By the way, web development is an easy area to hate. It seems to be all about staying compatible with very bad tools and platforms.
-
Use W3C Tidy on your HTML output;
-
Use an HTTP Accelerator / reverse proxy where appropriate (Squid, Varnish Cache, Nginx?), this gives easily a 10x speed gain on certain dynamic files;
-
Test that your pages are served compressed and uncompressed appropriately, and cached;
-
Test that your pages are served over HTTP 1.0 as well as HTTP 1.1; Varnish helpfully gave out a blank screen for certain HTTP 1.0 before the trunk 2.0 beta version;
-
Optimize your caching. Cookies are your enemies, as well as improper headers. When cookies are present, the HTTP cache cannot prove that they will not be used by the content object; therefore, it is often necessary to forcefully remove cookies from those requests that you know are not using them: mimetex.cgi is a good example.
-
Test your configuration with
HEAD,POSTandabtools. Don't forget to test with different headers, such as-H Cookie: a=bor-H Accept-Encoding: gzip,deflate. -
Design your software to make use of HTTP-level caching. RESTful services especially start to shine when cached appropriately.
-
When hacking third-party software, be prepared to waste a lot of time. And refrain from modifying its core files. When the next version comes out it will not be compatible with your changes. jQuery can do a lot of cosmetic changes on the end HTML level, and connecting it to a few RESTful endpoints can add functionality without hacking the legacy app.