#4992: Alter cache key based on GET parameters
---------------------------------------------+------------------------------
          Reporter:  anonymous               |         Owner:  nobody  
            Status:  reopened                |     Milestone:  post-1.0
         Component:  Cache system            |       Version:  SVN     
        Resolution:                          |      Keywords:          
             Stage:  Design decision needed  |     Has_patch:  0       
        Needs_docs:  0                       |   Needs_tests:  0       
Needs_better_patch:  0                       |  
---------------------------------------------+------------------------------
Comment (by PeterKz):

 Design-wise it would be great if the developer could be in control of
 which parameters that require a new cache item. After all, it is the
 developer who knows which parameters are likely to influence the result
 returned to the client. The currenct view cache decorator could be
 complemented like this:

 Vary by the entire URL (should be default behaviour):

 {{{
 @cache_page(60 * 15)
 @vary_by_param("*")
 def slashdot_this(request):
     ...
 }}}


 Only vary by values for parameter a and b (ignore everything else):

 {{{
 @cache_page(60 * 15)
 @vary_by_param(["a","b"])
 def slashdot_this(request):
     ...
 }}}

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