Comment

Carl Meyer

Right; it doesn't need to slim or write the files unless something has changed, but it does need to parse the HTML inside the template tags and check whether anything needs updated. This is the same as django-compressor. I agree that that overhead isn't a big concern.

django-compressor does already find and rewrite image links in CSS to make them absolute; would be easy to have it also tag them with a querystring for cache-busting at the same step. Guess I've never needed that because we use the Compass CSS framework, so image links in our CSS are already tagged that way before they ever get to the deploy step.

Parent comment

Peter Bengtsson

django-static works by maintaining a global dictionary variable that whenever you render the template it maps a filename (e.g. "/js/foo.js") to an "optimized" filename (e.g. "/js/foo.123513563.js") Only the first time does it need to do the necessary symlinking and whitespace compression so there is some extremely tiny overhead for each rendering. django-compressor, last time I checked, doesn't support sorting out the images inside the CSS files automatically. That's where most images are and those need to get the best filename rewrites to get the best setup.