I have been trying to implement more of Yahoo’s Rules for High Performance Web Sites. One of these is to gzip your components. It seems most servers serve html gzipped, but not css and javascript.

I contacted my webhost, MediaTemple, asking how I could get the grid-server configured to gzip my css and javascript. At first technical support didn’t seem to know what gzip was. After some back and forth I tried adding some lines to my .htaccess file to enable and configure mod_gzip. It turns out mod_deflate has replaced Apache 1.3’s mod_gzip in Apache2.

So if your site is hosted on an Apache2 server and mod_deflate is loaded you can add the following lines to the .htaccess file in your main web directory. Now the YSlow plugin for Firebug will give your site an “A” in the “Gzip components” category, and if you have results similar to mine your javascript and css files will be 60-70% smaller. Nice, yes?

The following code gzips everything but images.

# BEGIN gzip

# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary

# END gzip

Would you like to see the <canvas> element natively supported in IE8? If so, please consider joining Microsoft Connect and the Internet Explorer Beta Feedback program in particular in order to vote for <canvas> tag support in IE8.

Microsoft Connect
https://connect.microsoft.com/

Internet Explorer Beta Feedback
After signing up to Connect, go to the following page, scroll down to “Internet Explorer Beta Feedback” and click on Apply Now.
https://connect.microsoft.com/directory/

Request for <Canvas> Support in IE8
After that the following link will work which is the link to the suggestion for adding <canvas> support to IE8.
https://connect.microsoft.com/IE/feedback/ViewFeedback.aspx?FeedbackID=334060

Cheers,

Greg

Demo

Download

Release Notes:

  • Added functionality for creating multiple new windows from a single Json data request
  • Added animated canvas loading icon to xhr and iframe load methods
  • onContentLoaded now works with iframes
  • Added styling options which can be set globally and for individual windows
  • Added global effects option which toggles most of the window transition effects
  • Now you can set individual windows to be draggable, resizable, closable, maximizable, or minimizable, overriding the global settings (Joel Lindau)
  • Added closeAll() method which closes all windows at once
  • Added more examples
  • Fixed scrollbar bug in Firefox 2 on the Mac. Scrollbars no longer bleed through windows that are above them
  • Made speed optimizations (Joel Lindau)

Known Issues:

I added a YouTube example using Swiff. Opera 9 doesn’t play well with the Swiff, but did better with SWFobject. Mac Firefox 2 doesn’t do well with Flash in general.

Enjoy.