npm install appcache-nodeappcache-node
=============
###Why don't more people use HTML5 application cache?
Why! Why! Why!
This is for easy use in Express. The potential performance gain is pretty ridicuous.
In each HTML page you need to cache..
```
``
``
Other files to cache in your app.js
``
require('./appcache.js')({files: [
// no need to include html files that start with
'http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css'
, 'http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js'
]}, app)
``
Cache rebuilds upon app restart.
$ node test.js
###app.js
``
var express = require('express'), app = express();
app.listen(3000);
console.log('listening on 3000')
require('./appcache.js')({files: [
// no need to include html files that start with
'http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css'
, 'http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js'
]}, app)
app.all('/index.html', function(r, s){
s.sendfile('index.html')
})
``
###index.html
```
I am cached!
Save 140kb, caching Bootstrap
View cache in Chrome -- chrome://appcache-internals/