django-debug-toolbar/django-debug-toolbar — Issue #245: Cut down the size of transferred HTML for the template panel
Author: rassie
Created: 2012-01-05 17:04:51+00:00
State: open

This is a weird one... I don't have an obvious solution at hand, but nevertheless I want to file this as a bug.

I value the debug toolbar for everything it does, but it's usefulness sinks with the complexity of the site you are developing, since everything that is put into templates gets transferred to the browser a multitude of times in encoded form. Just a small example: a faily busy page I'm currently debugging is about 70 KiB with debug toolbar disabled, 280 KiB in size when only the template panel is disabled (i.e. already quadrupled in size). However, with the template panel enabled, it's a whooping 19.3 MiB big, which is about 280x the size! This slows down the page quite a bit: without the panel it downloads and loads within 4 seconds, with the panel it takes about a minute according to Chrome developer tools!

Like I said, I don't know a proper solution for this, probably some lazy-loading of the contents on demand (no problem with that BTW, it's waiting for the entire page including the toolbar to load which is unnerving), which would probably mean some kind of caching / database on the server side for the middleware to put the templates in. I'm positive you'll find something :-)