Hi Tom,

If the view is login required, then you must send 'Vary: cookie',
> there is no option. Consider what would happen if you did not vary on
> the cookie:
>
> Logged in user accesses the page via a caching proxy
> Returned page is cacheable, no Vary header
> Proxy stores page in cache
> Not logged on user requests the page via the proxy
> Proxy retrieves cached, logged on version of the page and delivers it
> to not logged on user
>
> Cheers
>
> Tom
>
>
Yes, you are right, I haven't considered intermediary proxy caches.
I was more concerned about what happens on the browser, as it seems that
Firefox handles the Vary: Cookie as Vary: * (ie. it doesn't use its cache
even if the session cookie is the same).
So, it seems that if Vary: Cookie is set, the only place I can benefit from
caching is on the server-side using Django's cache middleware.
That works fine, but the cache is per-user and t doesn't seem that I can
tell the caching middleware that I don't want that.

It looks like if you have a webapp that requires login for all the pages,
for pages that aren't user specific all you can do currently is to cache
manually in the view.
Is this true?

Ideally, I would like to be able to use the caching middleware in this
scenario by using only configuration + decorators.
Does this makes sense?

Thanks,

Tamas

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to