TrevorBurnham/connect-assets — Issue #74: Support for Cache Manifest
Author: joshmcarthur
Created: 2012-02-19 22:38:51+00:00
State: open

Hi,

I'd really like to use a cache.manifest to locally-cache some of the assets I'm using in an express app. Currently, my cache.manifest file looks like this:

```

CACHE MANIFEST

CACHE:
/css/app.css
/skeleton/base.css
/skeleton/layout.css
/skeleton/skeleton.css
http://cdnjs.cloudflare.com/ajax/libs/zepto/0.7/zepto.min.js
/js/spin.min.js
/js/app.js
/img/pin_small.png
/img/pin.png

NETWORK:
*
```

This works fine when `NODE_ENV=production` is not set, however in production the assets cannot be resolved, because they are written to with the MD5 digest appended to the filename - e.g. `/css/app.css -> /css/app-f01b01524455e4fd769f6de9641e4ae6.css`. There are two solutions I can think of:

1. Is there a way I can turn off the appending of the hash to the filename? I don't change the assets very often, and I'm pretty sure I'm the only one who uses this app.
2. More of a generic question, but is it possible to use the js(), css() etc functions to write the path to the stylesheet inside the cache.manifest? I'm currently using Jade for templating, but I don't think it supports anything other than HTML. Does anyone know of any alternatives that could allow me to 'template' my cache manifest?