#7338: Method .cache(timeout) in QuerySet
---------------------------------------------------+------------------------
          Reporter:  marinho                       |         Owner:  marinho
            Status:  assigned                      |     Milestone:         
         Component:  Database layer (models, ORM)  |       Version:  SVN    
        Resolution:                                |      Keywords:         
             Stage:  Design decision needed        |     Has_patch:  1      
        Needs_docs:  0                             |   Needs_tests:  0      
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Comment (by [email protected]):

 I agree with the invalidation problem. And as other have pointed out,
 there are lots of things you need to know about the application to know
 which is the best approach to invalidate. I do think that if the
 invalidation problem is solved, it's definitely a good idea to add this
 feature. Here are some requirements off the top of my head for proper
 invalidation requirements.

 1. Never invalidate option... have separate process refresh the cache on
 schedule (if something has been updated). Performance is most important
 feature here.
 2. Invalidate on any delete/update/insert (I think this should be the
 default). In this scenario data consistency is the most important feature.
 3. It's OK to have stale data, just allow it to expire and reload on use.
 Watch out for dog pile.
 4. Allow for flushing.
 5. Allow for automatic upgrade from memcache to local file cache if result
 set it too large (I currently use a hack in the cache system to handle
 this). Too large might be under the 1mb memcache limit.
 6. More advanced feature that allows for certain specific records to
 trigger invalidation. For example, if you query 5 models, only 1 of them
 should be an instant invalidate. The rest should just allow something like
 option 1 to run.

 I'd love to hear what requirements others think this feature should have.
 I've spent considerable time optimizing applications and integrating
 caching and having something that easily supports this out of the box for
 me would be great!

-- 
Ticket URL: <http://code.djangoproject.com/ticket/7338#comment:20>
Django <http://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