  cache = ConnectionProxy(caches, DEFAULT_CACHE_ALIAS)
  
  
  def close_caches(**kwargs):
      # Some caches -- python-memcached in particular -- need to do a cleanup at the
      # end of a request cycle. If not implemented in a particular backend
      # cache.close is a no-op
      for cache in caches.all():
          cache.close()
  
  
  signals.request_finished.connect(close_caches)
 
</s> remove         # pylibmc doesn't seem to have SERVER_MAX_VALUE_LENGTH as far as I can
        # tell from a quick check of its source code. This is falling back to
        # the default value exposed by python-memcached on my system.
        max_value_length = getattr(cache._lib, 'SERVER_MAX_VALUE_LENGTH', 1048576)
 </s> add         max_value_length = 2 ** 20 </s> remove             # Some clients (e.g. pylibmc) raise when the value is too large,
            # while others (e.g. python-memcached) intentionally return True
            # indicating success. This test is primarily checking that the key
            # was deleted, so the return/exception behavior for the set()
            # itself is not important.
 </s> add             # Most clients (e.g. pymemcache or pylibmc) raise when the value is
            # too large. This test is primarily checking that the key was
            # deleted, so the return/exception behavior for the set() itself is
            # not important.
    # Some caches need to do a cleanup at the end of a request cycle. If not
    # implemented in a particular backend cache.close() is a no-op.
  cache = ConnectionProxy(caches, DEFAULT_CACHE_ALIAS)
  
  
  def close_caches(**kwargs):
    # Some caches need to do a cleanup at the end of a request cycle. If not
    # implemented in a particular backend cache.close() is a no-op.
    # Some caches need to do a cleanup at the end of a request cycle. If not
    # implemented in a particular backend cache.close() is a no-op.
    # Some caches need to do a cleanup at the end of a request cycle. If not
    # implemented in a particular backend cache.close() is a no-op.
      for cache in caches.all():
          cache.close()
  
  
  signals.request_finished.connect(close_caches)
keep keep keep keep replace replace replace keep keep keep keep keep
 Fixed #32193 -- Deprecated MemcachedCache. 
django/core/cache/__init__.py