HTML and CSS Reference
In-Depth Information
passes 20 to 30K may have a negative effect on your application's performance. In this
case, the expense of compressing the data will be completely dwarfed by the expense of
the SQL work on the server side. A few other considerations to take into account before
flipping the compression switch on every request are:
• Ensure you are compressing only compressible content and not wasting resources
trying to compress uncompressible content
• Select the correct compression scheme for your visitors
• Configure the web server properly so compressed content is sent to capable clients
So, what should be compressed? Along with the obvious resources such as HTML, Java‐
Script, and CSS, several common text resource types should be served with HTTP
• XML.
• News feeds (both RSS and Atom feeds are XML documents).
• HTML Components (HTC). HTC files are a proprietary Internet Explorer feature
that package markup, style, and code information used for CSS behaviors. HTC
files are often used by polyfills , such as Pie or , to fix various problems
with IE or to back port modern functionality.
• Plain text files can come in many forms, from README and LICENSE files, to
Markdown files. All should be compressed.
• A text file used to tell search engines what parts of the website to crawl, Robots.txt
often forgotten, because it is not usually accessed by humans. Because robots.txt is
repeatedly accessed by search engine crawlers and can be quite large, it can consume
large amounts of bandwidth without your knowledge.
• Anything that isn't natively compressed should be allowed through HTTP com‐
pression. HTTP compression isn't just for text resources and should be applied to
all nonnatively compressed file formats. For example, Favicons (ICO), SVG, and
BMP image files are not natively compressed. ICO files are served up as an icon for
your site in the URL bar or tab of most browsers, so be sure these filed receive HTTP
The top two HTTP compression schemes are by far GZIP and DEFLATE. GZIP was
developed by the GNU project and standardized by RFC 1952 . GZIP is the most popular
Search WWH ::

Custom Search