Ticket #6173: cache.patch

File cache.patch, 832 bytes (added by eratothene, 7 years ago)
  • middleware/cache.py

    old new class CacheMiddleware(object): 
    7070        if not hasattr(request, '_cache_update_cache') or not request._cache_update_cache:
    7171            # We don't need to update the cache, just return.
    7272            return response
    73         if request.method != 'GET':
    74             # This is a stronger requirement than above. It is needed
    75             # because of interactions between this middleware and the
    76             # HTTPMiddleware, which throws the body of a HEAD-request
    77             # away before this middleware gets a chance to cache it.
    78             return response
    7973        if not response.status_code == 200:
    8074            return response
    8175        patch_response_headers(response, self.cache_timeout)
Back to Top