volojs/volo-appcache — pull request #3 by dangmai (2012-10-04 14:54:44+00:00)
Title: Options for extra files and fallback

As AppCache allows the CACHE section to include absolute paths to resources, I think it is necessary for volo-appcache to have the option of including extra paths in this section (e.g. to include resources from the CDN).

Also, I added option for the FALLBACK section.

Example for these options:

```javascript
appcache: require('volo-appcache')({
depends: [],
dir: 'www-built',
htmlPath: 'index.html',
manifestTemplate: '',
extras: [
'http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.2/jquery.min.js',
'http://cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js'
],
fallbacks: {
'/submit.php': 'offline.html'
}
}),
```

will output the manifest file:

```
CACHE MANIFEST
# ...

CACHE:
...
...
...
http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.2/jquery.min.js
http://cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js

# catch-all for anything else
NETWORK:
*
http://*
https://*

FALLBACK:
/submit.php offline.html
```