It's very good that Sune's and George's additions finally made their way
into Django. They brought more structure to http handling.
Now it is high time to start Q&A session. Qs:
1) If I want to use all 3 cache middlewares + session middleware, what is
the correct order now? Is this stack correct:
MIDDLEWARE_CLASSES = (
"django.middleware.sessions.SessionMiddleware",
"django.middleware.http.ConditionalGetMiddleware",
"django.middleware.gzip.GZipMiddleware",
"django.middleware.cache.CacheMiddleware",
"django.middleware.common.CommonMiddleware",
)
2) If I want to use GZipMiddleware, do I have to specify that my response
depends on presence of 'gzip' in HTTP_ACCEPT_ENCODING? Is it done
automatically? If not, how to specify it?
3) Do I have to define CACHE_MIDDLEWARE_GZIP? Or is it obsolete now?
4) Is it possible to use GZipMiddleware without cache?
Thanks,
Eugene
"Adrian Holovaty" <[EMAIL PROTECTED]> wrote
in message
news:[EMAIL PROTECTED]
On 10/8/05, hugo <[EMAIL PROTECTED]>
wrote:
> No, but it will give correct Vary header and set some Cache-control
> headers. Usually frameworks just ignore this stuff and send out stuff
> like Cache-control: private or even Pragma: no-cache - in fact
> disabling caching completely. Django will send out headers that allow
> caches to cache within the given limits, though. And it will do it in a
> controlled way that makes it easier to do the right thing :-)
All set! In [810], I checked in the patch from Hugo and Sune that
takes care of all the cache improvements.
Docs have also been updated:
http://www.djangoproject.com/documentation/cache/
http://www.djangoproject.com/documentation/middleware/
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org