Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
## Tell the server to gzip the content (Accept-Encoding header) - note the Content-Length that your server sends back on line 12 $ wget -S --header 'Cookie: _96methodsblog_session=78a55ae45c50aa255f0cc8d7c681237f' --header 'Accept-Encoding: gzip,deflate' http://www.96methods.com/admin/blog -O blog.gz --2009-02-18 19:45:44-- http://www.96methods.com/admin/blog Resolving www.96methods.com... 75.119.207.192 Connecting to www.96methods.com|75.119.207.192|:80... connected. HTTP request sent, awaiting response... HTTP/1.1 200 OK Date: Wed, 18 Feb 2009 08:45:45 GMT Server: Apache/2.2.11 (Unix) PHP/4.4.9 mod_ssl/2.2.11 OpenSSL/0.9.8c mod_fastcgi/2.4.6 Phusion_Passenger/2.0.5 DAV/2 SVN/1.4.2 Set-Cookie: _96methodsblog_session=78a55ae45c50aa255f0cc8d7c681237f; path=/ ETag: "e86c5e891da8a5dabef4619fb5f75be3" X-Runtime: 0.00626 Content-Length: 1998 Cache-Control: private, max-age=0, must-revalidate Vary: Accept-Encoding Content-Encoding: gzip Keep-Alive: timeout=2, max=100 Connection: Keep-Alive Content-Type: text/html; charset=utf-8 Length: 1998 (2.0K) [text/html] Saving to: `blog.gz' 42% [=======================> ] 841 --.-K/s in 1.9s 2009-02-18 19:45:46 (441 B/s) - Connection closed at byte 841. Retrying. ## Hmm content length of 1998 but only 841 bytes received. Let's do an ls - yep the gzipped file we received is actually only 841 bytes $ ls -al blog.gz -rw-r----- 1 jgk staff 841 18 Feb 19:45 blog.gz ## Now we'll request the same page, but without any gzipping (we have no Accept-Encoding header) - note the Content-Length from your server is still the same - 1998 $ wget -S --header 'Cookie: _96methodsblog_session=78a55ae45c50aa255f0cc8d7c681237f' http://www.96methods.com/admin/blog -O blog.html --2009-02-18 19:51:13-- http://www.96methods.com/admin/blog Resolving www.96methods.com... 75.119.207.192 Connecting to www.96methods.com|75.119.207.192|:80... connected. HTTP request sent, awaiting response... HTTP/1.1 200 OK Date: Wed, 18 Feb 2009 08:51:13 GMT Server: Apache/2.2.11 (Unix) PHP/4.4.9 mod_ssl/2.2.11 OpenSSL/0.9.8c mod_fastcgi/2.4.6 Phusion_Passenger/2.0.5 DAV/2 SVN/1.4.2 Set-Cookie: _96methodsblog_session=78a55ae45c50aa255f0cc8d7c681237f; path=/ ETag: "e86c5e891da8a5dabef4619fb5f75be3" X-Runtime: 0.05190 Content-Length: 1998 Cache-Control: private, max-age=0, must-revalidate Vary: Accept-Encoding Keep-Alive: timeout=2, max=100 Connection: Keep-Alive Content-Type: text/html; charset=utf-8 Length: 1998 (2.0K) [text/html] Saving to: `blog.html' 100%[==========================================================>] 1,998 --.-K/s in 0s 2009-02-18 19:51:13 (95.3 MB/s) - `blog.html' saved [1998/1998] ## let's just confirm that size with an ls of the HTML file we just received $ ls -al blog.html -rw-r----- 1 jgk staff 1998 18 Feb 19:51 blog.html ## so now let's just confirm that the gzipping is working correctly by gunzipping the blog.gz that we got before and then comparing the result with blog.html $ gunzip blog.gz $ diff blog blog.html $
This paste will be private.
From the Design Piracy series on my blog: