aces/brainbrowser — pull request #158 by pipitone (2014-09-07 06:42:33+00:00)
Title: Support for in-browser GZIP decompression when loading from URL

This pull request is meant to start discussion on implementing (gzip) decompression for files (rather than relying on the webserver to do that). I've taken a stab at it here, but happy to discuss other ways of doing it.

My interest in adding gzip decompression is that I'd like to host brainbrowser on a webserver that doesn't support the transparent decompression of files (e.g. streaming decompressed file data if the corresponding .gz file exists). Specifically, I'd like to host brainbrowser on github (via Pages), which this PR supports doing (see http://pipitone.github.io/brainbrowser/examples for a live version).

To make this as easy as possible, the current PR includes the default autodetection of gzipped resources by inspecting the filename (i.e. if it ends in .gz, assume it's gzipped data). Additions could include: detection based on file signature, and checking if a corresponding .gz resource exists and loading it instead.