miracle2k/django-assets

Filter-specific settings not working

Closed this issue · 5 comments

Settings like UGLIFY_JS_EXTRA_ARGS don't appear to be working. After a quick browse through the code, it looks like these were never implemented. If that's the case, I'm happy to do that and submit a pull request.

I would suggest using a dictionary such as ASSETS_OPTIONS to avoid polluting the rest of the settings file.

Whoops. This is totally my fault. I forgot to clear the cache after changing options.

Actually, I wonder if this can't work better. The filters, for the most part, have a standardized interface through which they expose the options they use, so these values could be added to the cache key.

That would be great if possible. At minimum, I think it would be nice to have the fact the cache does not depend on filter parameters be documented somewhere.

It seems like for ExternalTool and JavaTool adding the arguments given to subprocess to the cache key would solve the issue.

But that wouldn't work for filters that don't rely on external binaries. The better way to approach this would be to make Filter.id (which becomes part of the cache key already) include the Filter.options values.