The short version:  when processing a request, does Django *always*
collect session information from the session store before starting the
view?

The long version:

i have an application that makes heavy use of AJAX.  When a user
changes something on the page, the page fires an AJAX POST to apply
the changes to the database, then a series of AJAX GETs to refresh
other portions of the page.

Some of the GETs are expensive, so I have some process_response()
middleware that caches the HTML generated by the GET in the Django
session.  (It's the standard database session store.)  I also have
some process_request() middleware that either returns the cached HTML
if it can, or invalidates the cache on any POST.

Just to add to the fun, I have a four identical Django/mod_wsgi
instances running behind a round-robin load balancer.  So the POST
request might get handled by Django1, the first GET by Django2, the
second GET by Django3, and so on.

My problem is that sometimes the results of the POST are not visible
in the results of the GET.  The problem is intermittent, which is
leading me to point the finger at my cacheing strategy.  My assumption
was that Django would reload the session from the database every time
before starting my view code, but I'm wondering if that is not true
(or if there is some other issue that I'm not thinking about).

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to