Server-Side Techniques

Client-side optimization techniques can only take you so far. You can squeeze only so many bytes out of that GIF, JavaScript, or XHTML page. But as you'll discover, with server-side techniques, you can squeeze even more speed and HTTP requests out of popular pages. The idea is to shunt code from the client to the server, and let the server do more of the work. This chapter covers the following topics: conditional includes, browser sniffing, automatic URL abbreviation, form and CGI optimization, and faster Perl scripts with mod_perl.

These server-side techniques can save you and your users both time and space. They increase speed by reducing HTTP requests and shaving 20 to 30 percent off file sizes. They save maintenance costs by including site-wide code snippets. Best of all, these tools can help spice up your site with dynamic or randomized content.

As the name implies, server-side techniques require different levels of server access. Some technologies, such as XSSI, are probably already installed on your server, while others (mod_rewrite, configuration files) may require initial installation by your system administrator. But don't worry; you'll find instructions and sample configuration settings in this chapter. Note that this chapter shows how to configure the Apache server; Microsoft's IIS server can also perform SSI and URL rewrites with ISAPI filters.

Like most things in web design, each of these techniques involves tradeoffs. Each time you shunt more code (long URIs, CGI defaults) and work ([X]SSI) to the server, you make it work a little harder. For high-traffic pages like home pages, the tradeoff favors smaller page size and fewer HTTP requests over any server speed considerations.

 



Speed Up Your Site[c] Web Site Optimization
Speed Up Your Site[c] Web Site Optimization
ISBN: 596515081
EAN: N/A
Year: 2005
Pages: 135

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net