cobrateam/django-htmlmin — pull request #61 by moeffju (2013-11-27 11:30:41+00:00)
Title: Only process response if the request reached htmlmin

Django calls process_response for all middlewares, leading to performance problems with htmlmin in combination with a Cache middleware: the minified response is cached and delivered from cache, but minify still runs on it again.

This patch introduces a flag in the Request phase and checks it in the Response phase and only minifies when the request has also hit the middleware.