Open GoogleCodeExporter opened 9 years ago
When djangologging is installed after CacheMiddleware, the order of events is
as follows:
djangologging - process_request
CacheMiddleware - process_request
View function (or cached response)
CacheMiddleware - process_response
djangologging - process_response
If the page is in the cache, CacheMiddleware's process_response returns the
cached
response object, to which djangologging's process_response appends the HTML
output.
Since it is a single HttpResponse instance that is being manipulated, when you
re-request the page and CacheMiddleware returns it from it's cache a second
time,
that instance has already had the HTML appended to it before and is just
appended to
again and again.
Technically this seems to be correct, though may not be the most ideal
behaviour. I'm
open to suggestions of how this might be improved.
One solution might be to change djangologging's middleware to return a copy of
the
response and thus preventing a build-up of multiple logs. However, cloning a
HttpResponse may not be a trivial task, especially if the response is a
file-like
object, rather than a simple string.
Original comment by fras...@gmail.com
on 21 Dec 2007 at 1:13
Original issue reported on code.google.com by
dhar...@gmail.com
on 12 Dec 2007 at 6:12