HTML and CSS Reference
In-Depth Information
# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip
# Don't compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
The community project contains an excellent example of an
optimized .htaccess file. It's specifically crafted for web performance optimizations. It
provides a great starting point for implementing HTTP compression properly. It also
serves as a nice guide to compare to an existing web server configuration to verify you
master/.htaccess ).
You can view most other major server configurations for HTTP compression in the
github repository for HTML5Boilerplate ( ) , as
well as Figure 4-3 . Some of the configurations included are:
• Node.js
• Nginx
• lighttpd
• Google App Engine
After you think you have properly configured your web server from a compression and
optimization point of view, you must validate it. Web Sniffer is an excellent, free, web-
based tool that enables you make individual HTTP requests and see the responses. As
you can see in Figure 4-4 , Web Sniffer gives you some control over the userAgent and
Accept-Encoding headers to ensure that compressed content is delivered properly.
Search WWH ::

Custom Search