Interesting article
http://actionable-stats.com/website-performance-activate-gzip

In order to deliver gzipped content independent of the header you could also test for gzip compression in a small iframe by sending it compressed content. This compressed content is javascript which creates a cookie with a note of gzip support. On the server side you check the cookie and then send out gzipped content accordingly.

In apache it would look like

  RewriteCond %{HTTP:Accept-encoding} !gzip [OR]
  RewriteCond %{HTTP_COOKIE} !GZIP
  RewriteRule .* - [S=4]

JS in the iframe use http://plugins.jquery.com/project/cookie.

Allows for proxies & firewalls to be served gzipped content even though they might try to prevent it.

CommentFileSizeAuthor
#1 boost-gzip-cookie-test.html_.gz368 bytesmikeytown2

Comments

mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new368 bytes

Add this to your htaccess file

  # Gzip Cookie Test
  RewriteRule boost-gzip-cookie-test\.html boost-gzip-cookie-test\.html\.gz [L,T=text/html]

  # Skip boost IF not get request OR uri has wrong dir OR cookie is set OR https request
...

  # GZIP
  RewriteCond %{HTTP_COOKIE} !(boost-gzip) [OR]
  RewriteCond %{HTTP:Accept-encoding} !gzip
  RewriteRule .* - [S=5]

Add this to a block, front page only

<iframe src='/boost-gzip-cookie-test.html' style="width:0px; height:0px; border: 0px"></iframe>

place this file in your webroot make sure its called
boost-gzip-cookie-test.html.gz

mikeytown2’s picture

Status: Needs review » Postponed

not sure if this will ever be committed, but its here.

mikeytown2’s picture

Status: Postponed » Closed (duplicate)