Re: caching and authentication

2007-09-16 Thread patrickk
thanks for the answer. we _are_ doing a redirect on logout. On 16 Sep., 16:17, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 9/13/07, patrickk <[EMAIL PROTECTED]> wrote: > > > if 2 users are logged in, the username is displayed correctly for each > > user. BUT: if a user is logged-out, his/he

Re: caching and authentication

2007-09-16 Thread James Bennett
On 9/13/07, patrickk <[EMAIL PROTECTED]> wrote: > if 2 users are logged in, the username is displayed correctly for each > user. BUT: if a user is logged-out, his/her username is still > displayed. something doesn´t seem to work here and I can´t figure out > what´s wrong. If a user logs out, the

Re: caching and authentication

2007-09-16 Thread patrickk
does anyone have an idea? we should go online with our site tomorrow and I don´t have a clue on how to solve this problem. thanks, patrick On 13 Sep., 10:23, patrickk <[EMAIL PROTECTED]> wrote: > one additional note: > if 2 users are logged in, the username is displayed correctly for each > user

Re: caching and authentication

2007-09-13 Thread patrickk
one additional note: if 2 users are logged in, the username is displayed correctly for each user. BUT: if a user is logged-out, his/her username is still displayed. something doesn´t seem to work here and I can´t figure out what´s wrong. On 13 Sep., 10:14, patrickk <[EMAIL PROTECTED]> wrote: > I´

Re: caching and authentication

2007-09-13 Thread patrickk
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_ob

Re: caching and authentication

2007-08-29 Thread patrickk
thanks jeremy. answer to "what isn´t working": on the top of each page, we have two links which depend on whether the user is authenticated or not. either: username / logout (if authenticated) or: login / register (if not authenticated) when I use cache_page (with or without patch_vary_headers r

Re: caching and authentication

2007-08-29 Thread Jeremy Dunck
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 middlewar

Re: caching and authentication

2007-08-29 Thread patrickk
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 t

Re: caching and authentication

2007-08-29 Thread patrickk
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):

Re: caching and authentication

2007-07-07 Thread Jeremy Dunck
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

Re: caching and authentication

2007-07-07 Thread patrick k.
Am 07.07.2007 um 19:36 schrieb Honza Král: > On 7/7/07, patrick k. <[EMAIL PROTECTED]> wrote: >> >> >> Am 07.07.2007 um 02:13 schrieb Jeremy Dunck: >> >>> >>> On 7/6/07, patrickk <[EMAIL PROTECTED]> wrote: when having a header where the username and a logout-button is displayed, h

Re: caching and authentication

2007-07-07 Thread Honza Král
On 7/7/07, patrick k. <[EMAIL PROTECTED]> wrote: > > > Am 07.07.2007 um 02:13 schrieb Jeremy Dunck: > > > > > On 7/6/07, patrickk <[EMAIL PROTECTED]> wrote: > >> > >> when having a header where the username and a logout-button is > >> displayed, how do you cache this page/view? > > > > There's a CA

Re: caching and authentication

2007-07-07 Thread patrick k.
Am 07.07.2007 um 02:13 schrieb Jeremy Dunck: > > On 7/6/07, patrickk <[EMAIL PROTECTED]> wrote: >> >> when having a header where the username and a logout-button is >> displayed, how do you cache this page/view? > > There's a CACHE_MIDDLEWARE_ANONYMOUS_ONLY setting if you want to only > do anony

Re: caching and authentication

2007-07-06 Thread Jeremy Dunck
On 7/6/07, patrickk <[EMAIL PROTECTED]> wrote: > > when having a header where the username and a logout-button is > displayed, how do you cache this page/view? There's a CACHE_MIDDLEWARE_ANONYMOUS_ONLY setting if you want to only do anonymous caching. But I think you must have your cache middlew

Re: caching and authentication

2007-07-06 Thread [EMAIL PROTECTED]
Yes. However, you can probably cut down on your code in the view a bit by saying if the user is authenticated, then don't add it to the cache. If they are not authenticated, cache the result. This should allow you to render the template once, then conditionally cache the result after rendering.

caching and authentication

2007-07-06 Thread patrickk
when having a header where the username and a logout-button is displayed, how do you cache this page/view? when using the per-view cache, the authentication doesn´t work anymore (that means that my username is still displayed in the header, although I´m already logged out). when using the l