Ticket #5176: 0001_generate_cache_key.diff

File 0001_generate_cache_key.diff, 1.2 KB (added by lcordier, 6 years ago)

A much more elegant solution.

  • django/utils/cache.py

     
    2323    set
    2424except NameError:
    2525    from sets import Set as set   # Python 2.3 fallback
     26from Cookie import SimpleCookie
    2627
    2728from django.conf import settings
    2829from django.core.cache import cache
     
    141142    ctx = md5_constructor()
    142143    for header in headerlist:
    143144        value = request.META.get(header, None)
     145        if isinstance(value, SimpleCookie):
     146            value = value.output()
     147       
    144148        if value is not None:
    145149            ctx.update(value)
    146150    return 'views.decorators.cache.cache_page.%s.%s.%s' % (
  • AUTHORS

     
    239239    Lau Bech Lauritzen
    240240    Rune Rønde Laursen <runerl@skjoldhoej.dk>
    241241    Eugene Lazutkin <http://lazutkin.com/blog/>
    242     lcordier@point45.com
     242    Louis Cordier <lcordier@gmail.com>
    243243    Jeong-Min Lee <falsetru@gmail.com>
    244244    Jannis Leidel <jl@websushi.org>
    245245    Christopher Lenz <http://www.cmlenz.net/>
Back to Top