#5691: Add the active language to generate the cache key
-------------------------------------+--------------------------------------
          Reporter:  [EMAIL PROTECTED]  |         Owner:  nobody    
            Status:  new             |     Milestone:            
         Component:  Cache system    |       Version:  SVN       
        Resolution:                  |      Keywords:  cache i18n
             Stage:  Accepted        |     Has_patch:  1         
        Needs_docs:  1               |   Needs_tests:  1         
Needs_better_patch:  1               |  
-------------------------------------+--------------------------------------
Comment (by aaloy):

 I'm working on a patch which could work as:

 {{{
     cache_key = 'views.decorators.cache.cache_header.%s.%s' % (
                       key_prefix, iri_to_uri(request.path))
     if settings.USE_I18N:
        cache_key += ".%s" % translation.get_language()
 }}}

 I have tested using other ways of string concatenations and this one is
 the fast way (0.6 s for 10^6 interactions) for the kind of keys we're
 generating.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5691#comment:9>
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 django-updates@googlegroups.com
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