Technique for subclassing Django UpdateCacheMiddleware and FetchFromCacheMiddleware
问题 I've used the UpdateCacheMiddleware and FetchFromCacheMiddleware MiddleWare to enable site-wide anonymous caching to varying levels of success. The biggest problem is that the Middleware only caches an anonymous user's first request. Since a session_id cookie is set on that first response, subsequent requests by that anonymous user do not hit the cache as a result of the view level cache varying on Headers. My webpages do not meaningfully vary among anonymous users and, in so far as they do