0% found this document useful (0 votes)
26 views

HTTP Compression - HttpWatch

HTTP compression allows web servers to compress content like HTML pages before sending them to clients to reduce file sizes and download times. Common compression algorithms are deflate and gzip. Clients indicate support for compression using the Accept-Encoding header and servers use the Content-Encoding header to specify the compression method. Comparing a page with and without compression using browser tools like HttpWatch shows the savings in file size and bandwidth from compression.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

HTTP Compression - HttpWatch

HTTP compression allows web servers to compress content like HTML pages before sending them to clients to reduce file sizes and download times. Common compression algorithms are deflate and gzip. Clients indicate support for compression using the Accept-Encoding header and servers use the Content-Encoding header to specify the compression method. Comparing a page with and without compression using browser tools like HttpWatch shows the savings in file size and bandwidth from compression.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

7/4/2017 HTTPCompression|HttpWatch

(/)

HTTP Gallery

Jump to ...

8. HTTP Compression
HTTP compression allows content to be compressed on the server before transmission to the client. For resources such as text this can
signicantly reduce the size of the response message, leading to reduced bandwidth requirements and download times.

Some content types such as zip les or gif images are already compressed and do not respond well to compression. In fact, attempting to
compress them can increase the size of the response message and waste CPU time on the server.

Compression is particularly useful where secure SSL connections are used, because it reduces the amount of content that has to be encrypted
on the server and decrypted by the client.

Two compression algorithms are commonly used - deate and gzip. HTTP clients indicate their support of compression using the Accept-
Encoding header as shown here:

AcceptEncoding:gzip,deflate

A server will only compress content for clients that support compression and will set the Content-Encoding header so that the client knows
which algorithm to use when reading the response body:

ContentEncoding:gzip

If you look at the response message for a compressed page you will see that the response headers are in clear, uncompressed text and the
HTML content is in a compressed binary format:

HTTP/1.1200OK
CacheControl:private
ContentType:text/html
ContentEncoding:gzip
ContentLength:1253
Date:Wed,25Feb201512:00:00GMT

[1253bytesofbinarycompressedHTMLdatastartshere]

Example 8
Question: How much dierence did compression* make to each of the following?

A. This page HTML page?

B. This image (smallpic.jpg)?

REFRESH THIS PAGE

https://www.httpwatch.com/httpgallery/compression/ 1/2
7/4/2017 HTTPCompression|HttpWatch
(* if you are accessing this page through a proxy server it may remove compression)

SHOW ANSWERS

Using HttpWatch with Example 8

To view the eect of HTTP compression on this page:

1. Open HttpWatch by right clicking on the web page and selecting HttpWatch from the context menu

2. Click on Record to start logging requests in HttpWatch

3. Add a lter to capture only gzip compressed pages by adding a 'Response Headers Contain' condition with the value "gzip".

4. Click on the Refresh this page button above

5. You can see the raw response message by clicking on the Stream tab and the compression savings are displayed on the Content
tab

<7. REDIRECTION (../REDIRECTION/) 9. CHUNKED ENCODING> (../CHUNKED/)

Ready to get started?

TRY FOR FREE

(/DOWNLOAD/)
BUY NOW (/BUY/)

HttpWatch
Features (/features/httpdebugger.aspx)
Compare Editions (/editions.aspx)
New in Version 10.x (/newin10x.aspx)
Download (/download/)
Pricing (/buy/)

Our Customers
Who is using it? (/#customers)
What are they saying? (/#quotes)

Learning & Documentation


HttpWatch Blog (http://blog.httpwatch.com)
HTTP Gallery (/httpgallery/)
HttpWatch Help (http://help.httpwatch.com)
HttpWatch Automation Reference (http://apihelp.httpwatch.com)

Support
Technical Support (/support/)
About Us (/company/)
Contact Us (/company/)
Blog (http://blog.httpwatch.com)
Twitter (https://twitter.com/httpwatch)

https://www.httpwatch.com/httpgallery/compression/ 2/2

You might also like