On 08/26/2010 07:08 PM, Alessandro Ronchi wrote:
Is this middleware classes correctly ordered for performance?
thanks in advance,

MIDDLEWARE_CLASSES = (


"django.middleware.common.CommonMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.locale.LocaleMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.middleware.doc.XViewMiddleware",
'django.middleware.gzip.GZipMiddleware',
'django.middleware.http.ConditionalGetMiddleware',
'pagination.middleware.PaginationMiddleware',
"django.contrib.flatpages.middleware.FlatpageFallbackMiddleware",
'django.contrib.redirects.middleware.RedirectFallbackMiddleware',

I don't know about performance, but at least the GZipMiddleware documentation says it has to be right at the top to prevent errors. It mucks about with the content-length, that's why.

By the way: have you already optimised the non-django-view parts of your application? Combined js; combined css; static hosting of media files by apache/ngnix; perhaps a varnish cache; etc.

Optimizing *there* might bring more returns than a heaping amount of middleware.


Reinout


--
Reinout van Rees - [email protected] - http://reinout.vanrees.org
Collega's gezocht!
Django/python vacature in Utrecht: http://tinyurl.com/35v34f9

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to