Tuesday, April 28, 2009

Halve your site's page sizes in 5 minutes

This reduces our page sizes by up to 50%+

from django.utils.html import strip_spaces_between_tags
from django.conf import settings

class SpacelessMiddleware(object):
def process_response(self, request, response):
if not settings.DEBUG:
if 'text/html' in response['Content-Type']:
response.content = strip_spaces_between_tags(response.content)
return response

Tuesday, March 03, 2009

I havent had to worry about SQL recently


I'm happy django does all the database work for me so i can spend my time building features and writing the same snippets of code all over the application.