code: def set_cache(self, request, response):
          
  
          try:
              cache_key = self.cache_key(request)
              #presumably this is to deal with requests with attr functions that won't pickle
              if hasattr(response, 'render') and callable(response.render):
                  response.add_post_render_callback(lambda r: cache.set(cache_key, (r, time.time(),), settings.BETTERCACHE_LOCAL_MAXAGE))
              else:
                  cache.set(cache_key, (response, time.time(),) , settings.BETTERCACHE_LOCAL_MAXAGE)
          except:
              logger.error("failed to cache to %s" %cache_key)
docs: caches the response supresses and logs exceptions