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.

On Jul 6, 5:40 am, patrickk <[EMAIL PROTECTED]> wrote:
> 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 low-level cache it works, but we have to split the
> templates:
> - first render (and cache) the site without the header
> - then render the cached template with the header
>
> is this (using the low-level cache) the best way doing this?
>
> thanks,
> patrick


--~--~---------~--~----~------------~-------~--~----~
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