I´ve upgraded to the current trunk and it´s still not working. this is my views:
def top_imagegalleries(request): ... response = render_to_response('site/container/ topimagegalleries.html', { 'object_list_left': rendered_object_list_left, 'object_list_right': rendered_object_list_right, 'category': 'filme', 'subcategory': 'bildgalerien', 'site_title': 'Bildgalerien', 'title': 'Bildgalerien', 'sidebar_list': rendered_sidebar_list, 'limit': limit.limit, }, context_instance=RequestContext(request) ) patch_vary_headers(response, ['Cookie']) return response top_imagegalleries = cache_page(top_imagegalleries, 60 * 15) My username is still displayed on the page when I´m logged out. For most of our pages, we use cached blocks within the site, but that doesn´t work for all the pages we have. We have to cache some high- traffic pages as a "whole" (still displaying the right username though). thanks, patrick On 29 Aug., 17:33, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > It's clear to me that the docs involving patch_vary_header, cache_page > and the cache middleware need to be improved. > > I'm using this thread as proof. :) > > The cache_page decorator is actually just a wrapper around the cache > middleware; think of it as view-specific application ofthe cache > middleware. > > In any case, thepatch_vary_headers*should* work with the cache_page > decorator; the decorator forms the cache key based on the response. > This is a separate problem from the unicode issue. > > Can you provide any info on what isn't working as expected with > thepatch_vary_headerscall? > > On 8/29/07, patrickk <[EMAIL PROTECTED]> wrote: > > > > > I´ve been too optimistic - the above code doesn´t work. > > (This whole caching-issue gives me the willies) > > > On 29 Aug., 12:21, patrickk <[EMAIL PROTECTED]> wrote: > > > it´s a bit late, but I just wanted to tell that it works with > > >patch_vary_headers. > > > in my opinion, this could be explained better in the docs. > > > > so, if one uses a page based on user-authentication and wants to cache > > > that page using the cache_page decorator, here´s the code: > > > > def my_view(request): > > > .... > > > > response = render_to_response('site/whatever/template.html', { > > > ... > > > }, context_instance=RequestContext(request) ) > > > patch_vary_headers(response, ['Cookie']) > > > return response > > > my_view = cache_page(may_view, 60 * 15) > > > > thanks, > > > patrick > > > > On 8 Jul., 01:18, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > > > > > On 7/7/07, patrick k. <[EMAIL PROTECTED]> wrote: > > > > > > I don´t understand why the page_cache is keyed by the vary header and > > > > > the view_cache is not. is there a reason for this? > > > > > You mean cache_page rather than page_cache, but what is view_cache? > > > > > I think I may have spotted the problem: the cache_page decorator runs > > > > before the Vary header gets patched for the session access. > > > > > As a test, just before you return your HttpResponse, try adding this > > > > to one of your auth views, and try to use the cache_page decorator: > > > > > from django.utils.cacheimportpatch_vary_headers > > > >patch_vary_headers(response, ('Cookie',)) > > > > > (Maye sure to dump yourcachefirst, too.) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---