#16708: Session backend cached_db's exists() does not check cache before 
database
-------------------------------------+-------------------------------------
               Reporter:  jpvale@…   |          Owner:  nobody
                   Type:             |         Status:  new
  Cleanup/optimization               |      Component:  contrib.sessions
              Milestone:             |       Severity:  Normal
                Version:  SVN        |       Keywords:  session cache
             Resolution:             |  cached_db
           Triage Stage:  Design     |      Has patch:  1
  decision needed                    |    Needs tests:  1
    Needs documentation:  0          |  Easy pickings:  0
Patch needs improvement:  0          |
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
Changes (by aaugustin):

 * needs_better_patch:   => 0
 * stage:  Unreviewed => Design decision needed
 * needs_tests:   => 1
 * needs_docs:   => 0


Comment:

 This file was never modified since it was checked in at r9727.

 The current behavior may be an omission that went through the reviews
 unnoticed, or an implementation choice: it avoids loading the contents of
 the session just to check if it exists. The comments on #6791 don't
 mention it.

 Since Django's cache API doesn't provide `cache.exists(key)`, there's no
 way to check if a session exists in the cache without getting the contents
 of the session. It's impossible to optimize this for the general case,
 because it depends on the speed/scalability of the database, the
 speed/scalability of the cache, and the size of the session.

 Since sessions tend to be small, I'm +0 on this change.

 If it's accepted, the patch would need tests.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16708#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" 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-updates?hl=en.

Reply via email to