I've added an option to enforce the update of cached css files on each request.
Certainly, this is nothing you want to use in production. Here is how I'm using it:
For very small projects, we don't want to have less files compiled in production environments. So we simply check in the compiled css files and deploy those. Using rack-less and let it recreate the cache files spares us an extra tool to do the job.
new option enforcing cached files to be updated
overwrite the cached file if caching is enabled and the 'update_cache' option is set
well, that does not get it yet in real live.
the purpose is, to generate the cached file into the default public/stylesheets in order to get it served with non-rack-less production environments.
adding missing config defaults. made request aware of the update_cach…
@fnordfish - let me restate what you are asking for and make sure I understand what you are wanting.
Is that a correct description of the problem?
The only weird issue I see is that if you are writing files to public/stylesheets, how do you make it so your development env won't pick those up? Once stylesheets are generated there, I don't think requests for them even hit the rack stack? Am I correct?
@kelredd that's exactly what I was asking.
The thing is, that rack itself does not prefer static files unless you use Rack::Static.
So basically, if the request gets to your thin/webrick/whatever and is not redirected by some proxy (varnish/nginx/apache/...) this will hit rack. After that, it depends on the execution order of rack middle-wares.
in response to #9:
* respond to the request even if the file has been cached.
Closing in favor of solution in #10.
version to v3.0.2
* better cache behavior (#10/#9)
* when caching, rack-less will always respond and re-cache (whether a cached file for the request exists or not)