ChicagoBoss gurus:
We have hit a small issue with the way static files are handled. As you all know, ChicagoBoss uses simplebridge as a layer on top of the various web servers (cowboy, mochi, etc.), and it has a a nice shortcut for serving "static" files.
Unfortunately, that code sets the web cache expiration time to 10 years. For example, from mochiweb_response_bridge.erl line 36 in simple_bridge:
{file, Path} ->
ExpireDate = simple_bridge_util:expires(years, 10),
%% Create the response telling Mochiweb to serve the file...
Headers = [{"Expires", ExpireDate}],
Req:serve_file(tl(Path), DocRoot, Headers)
The upshot it seems is that any file served from /priv/static has a 10 year expiry period. This is starting to hit us as we want to both a) have our javascripts/etc. cached for frequent users and b) be able to update our product regularly (we're on a weekly update schedule currently). So a 1 day cache would be much better than 10 years.
One workaround is fairly straightforward, we just write my own dynamic handle in ChicagoBoss to deal with these files. ~But~ that seems a bit counter to the spirit of ChicagoBoss, so I'm wondering if we're missing something obvious / another way to do this.
Separately, but related is it'd be great for ChicagoBoss to eventually get an asset management feature like how Rails does it, so it'd be easier to do things like html/js minification, etc. If anybody is interested in collaborating on this feel free to ping me offline...
thanks!
alex