On Mon, 2008-09-29 at 16:32 -0700, Cortland Klein wrote:
> I've enabled caching via UpdateCacheMiddleware and  
> FetchFromCacheMiddleware, placed at the beginning and end of  
> middleware, respectively.
> 
> When loading a URL, I'm getting a Vary: Accept-Encodinge.
> 
> Problem is, each page load Google Analytics keeps changing  
> __utm(a,b,c,z) cookies, apparently invalidating cache.

So things are working as expected then. Django cannot know that this
particular instance of a changing cooking means the page is safe to
cache. That's just the trade-off you make when deciding to use Google
analytics. You could write your own version of the caching middleware
(after all, it's just middleware and it's easy to write and use your
own) that ignore a configurables set of cookies or something, but then
how will you know that it's just the Google cookie that has changed and
not the Django cookie?

In short: Django's caching middleware isn't designed to work
transparently with this situation. It caches things that haven't changed
and, in your situation, the content has potentially changed so doesn't
match the cached version. You'll need to adopt a different caching
scheme -- perhaps something lower-level.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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