code: def cache_result(default_size=settings.AVATAR_DEFAULT_SIZE):
      
      if not settings.AVATAR_CACHE_ENABLED:
          def decorator(func):
              return func
          return decorator
  
      def decorator(func):
          def cached_func(user, size=None, **kwargs):
              prefix = func.__name__
              cached_funcs.add(prefix)
              key = get_cache_key(user, size or default_size, prefix=prefix)
              result = cache.get(key)
              if result is None:
                  result = func(user, size or default_size, **kwargs)
                  cache_set(key, result)
              return result
          return cached_func
      return decorator
docs: Decorator to cache the result of functions that take a ``user`` and a
      ``size`` value.