Version 1, last updated by Andrew Davey at May 28, 2009 00:19 UTC

Snooze isn't just about making you develop web apps in a RESTful style! It also provides some extra tools that most web apps need.

  • IE5.5/6 transparent PNG support
  • Static, versioned, file handler
  • GZip and deflate compression IHttpModule

Add the following routes:

routes.AddIE6Support();
routes.AddVersionedStaticFilesSupport();

Put this into your main css file:

img
{
_behavior: url(/ie6support/pngbehavior.htc);
}

and you now have transparent PNG support in IE5.5 and 6.

Static versioned files include javascript, css, images and anything else that, once served to a client, doesn't need to be sent again. The route url looks like "static/{Version}/{*Path}". The Version parameter will equal the assembly version of your application. The Path will be a file path relative to your application root e.g. "static/1.0.0.0/images/logo.jpg".

Files are served with a far future expires header (10 years from now), so the web browser will cache and should not ask for them again. If you do make changes to the web content, then bump the version number of the assembly and re-deploy.

You can generate static urls using the StaticFileUrl class.

Compression Module

Add this line to your web.config's httpModules section:

<add name="CompressionModule" type="Snooze.Modules.CompressionModule, Snooze"/>

That's it! You now have deflate and gzip compression enabled!