This moves caching/gzipping into its own middleware. This simplifies Minify.js a lot and gets things ready for moving the packaging logic out and into its own middleware in this branch.
This is mostly just moving code. It would be nice if this could be replaced by separate (and existent) gzipping and caching middlewares.
Note: this caching layer also respects the expires header, so in development, it will be important to add "maxAge": 1 in settings.
Can you add the new setting into settings.json.template?
Also, I feel like this minify thing gets more and more owned by you. Can you add some more comments please?
@Pita, adjusted the settings template. Minify almost to the point of being stable – then I will get around to documenting it. After this branch it will be much simpler and easy to document.
Note: in a few branches from now versioning should probably be added to the asset URLs so that the 6 hour maxAge doesn’t cause issues when server-side code changes (and the maxAge can be raised to a year or longer).
Extract lastmodified from handler.
Catch 304's early.
Create CachingMiddleware for zipping and caching.
Support GET and HEAD.
Inline response generation.
Allow maxAge of server to be specified in a setting.
Minify specifies maxAge.
Use the correct expression.