nightscout/cgm-remote-monitor — pull request #16 by brianhanifin (2014-06-21 00:57:53+00:00)
Title: Gzip / Caching Improvements

First, I modified `nodeStatic.Server(".")` to include a 30 day cache and enabled gzip compression. It may only make a small difference with the .mp3 files, but the js and css files are much smaller when gzipped. I added gzipped versions of the MP3 files (e.g. `alert.mp3.gz`).

```
var staticServer = new nodeStatic.Server(".", { cache:2592000, gzip:true });
```

Next, using [appcache-node](https://github.com/dpweb/appcache-node) I implemented an "offline" [HTML 5 Application Cache](http://www.w3schools.com/html/html5_app_cache.asp). Below is the generated nightscout.appcache file. The "NETWORK:" group defines the files that should never be cached offline. By specifying an asterisk we are saying that no other file should be cached (socket.io won't work if cached for example).

### nightscout.appcache
```
CACHE MANIFEST

CACHE:
http://localhost:1337/audio/alarm.mp3
http://localhost:1337/audio/alarm2.mp3
http://localhost:1337/audio/alarm.mp3.gz
http://localhost:1337/audio/alarm2.mp3.gz
http://localhost:1337/css/dropdown.css
http://localhost:1337/css/main.css
http://localhost:1337/js/client.js
http://localhost:1337/js/dropdown.js
http://localhost:1337/favicon.ico

NETWORK:
*

# Fri Jun 20 2014 17:49:43 GMT-0700 (PDT)
```

I believe this is proof that the .mp3 files are being cached (showing a 304 Not Modified status). This as screenshot of Live HTTP Headers:

![proof](https://www.evernote.com/shard/s1/sh/bd9967b4-2f82-40bd-9084-6008dac7fa95/9c8e042d4abb9682ca90e2c63dbf6632/deep/0/Live-HTTP-Headers.png)

This is my first big stab at contributing. What do you think? I have it working both locally and on a test Azure server.