Performance Tips for HTML Authors
Make It Easy on the Server
When composing HTML, try to keep pathnames short, both in number of directories
in the path and in the length of each directory name. Keep the target file name
short, too. Make your links explicitly refer to index.html files or end
directory references with /
. More on this later.
You can scale static content easily by partitioning the content across multiple servers and using HTML links to the different servers. To start out partitioning, consider using one server for images, another for HTML, another for applets, etc. Also keep in mind that your HTML can refer quite easily to other web sites for embedded content, entirely removing the load from your servers but creating a dependency on the other server and making for twisty copyright issues. For example, the Gamelan (http://www.gamelan.com/) applet directory does not have applets itself but simply links to the sites that do, with the authors’ consent. There has recently been some legal action against a site that was embedding news from other web sites in frames and selling its own advertising in a top frame.
Going the other way, if you need to have a link on your page to a site known to be very slow, consider asking the site’s administrator for permission to mirror the page or site on your own web server.
If your content is a huge number of files with a fairly even distribution of access--say, in a large archive—then your OS’ buffer cache and the web server’s cache aren’t ...
Get Webmaster in a Nutshell, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.