On Nov 3, 10:24 am, "Collin Grady" <[EMAIL PROTECTED]> wrote:
>
> I think you're confused - the context processor doesn't set a cookie,
> so it isn't causing any Vary behavior, and admin *does* currently
> depend on it - it needs the info the processor provides. Unless admin
> was rewritten to add them to context manually on every view, it will
> continue to need it.
no it does not set a cookie, but it accesses the session which then
causes the "Vary: Cookie" header to get set (look at the session
middleware if the session is accessed at all the Vary: cookie is set).
>
> > and one would need to override every other function that calls
> > "template.RequestContext' which is most of the meat of sites.py.
>
> Uh, no you wouldn't - if you tell admin not to check for that context
> processor, you could replace the auth processor with a custom one that
> only works in admin's path and as such wouldn't add any db hits to the
> rest of the site.
the goal is to REMOVE the dependency on the auth context processors
for admin, but use it if it is included. Thus to effectively do that
one needs to redo "template.RequestContext" inside sites.py to set the
user/messages/perms if not present already. The "default" behavior
just to include admin (without any alterations) basically require a
session access for every page in a given 'app/project'. To me this is
alot of overhead to "start" with and alot more work to "remove" it.
Yes i know i can hack around the issue (and currently do), but i'm not
sure just how many folks out there realize that just by including the
auth context processor, effectively all you can cache is _one_ page
per user/sessionid rather then caching the page for arbitrary
anonymous users. This may indeed be the desired behavior for some
sites, but certainly not all.
So i'm proposing a change to sites.py that does not effect any
backwards compatibility, but will improve django's performance in a
good number of use cases.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---