flash service

High_Performance_Web_Sites

Issue link: https://read.uberflip.com/i/1146286

Contents of this Issue

Navigation

Page 56 of 169

Gzip in Action | 35 mod_gzip/cache.htm) goes as far as to say, "using filter rules evaluating the User- Agent HTTP header will lead to totally disabling any caching for response packets." Because this virtually defeats proxy caching, another approach is to disable proxy caching explicitly using a Vary: * or Cache-Control: private header. Because the Vary: * header prevents the browser from using cached components, the Cache- Control: private header is preferred and is used by both Google and Yahoo!. Keep in mind that this disables proxy caching for all browsers and therefore increases your bandwidth costs because proxies won't cache your content. This decision about how to balance between compression and proxy support is com- plex, trading off fast response times, reduced bandwidth costs, and edge case browser bugs. The right answer for you depends on your site: • If your site has few users and they're a niche audience (for example, an intranet or all using Firefox 1.5), edge case browsers are less of a concern. Compress your content and use Vary: Accept-Encoding. This improves the user experience by reducing the size of components and leveraging proxy caches. • If you're watching bandwidth costs closely, do the same as in the previous case: compress your content and use Vary: Accept-Encoding. This reduces the band- width costs from your servers and increases the number of requests handled by proxies. • If you have a large, diverse audience, can afford higher bandwidth costs, and have a reputation for high quality, compress your content and use Cache- Control: Private. This disables proxies but avoids edge case bugs. There is one more proxy edge case worth pointing out. The problem is that, by default, ETags (explained in Chapter 13) don't reflect whether the content is compressed, so proxies might serve the wrong content to a browser. The issue is described in Apache's bug database (http://issues.apache.org/bugzilla/show_bug. cgi?id=39727). The best solution is to disable ETags. Since that's also the solution proposed in Chapter 13, I go into more detail about ETags there. Gzip in Action Three examples for Rule 4 demonstrate the different degrees of compression you can deploy across your site. Nothing Gzipped http://stevesouders.com/hpws/nogzip.html HTML Gzipped http://stevesouders.com/hpws/gzip-html.html Everything Gzipped http://stevesouders.com/hpws/gzip-all.html

Articles in this issue

Links on this page

Archives of this issue

view archives of flash service - High_Performance_Web_Sites