Get the cache backend

        Returns
        ~~~~~~~
        Django cache backend
773473
def cache_backend(self):
        
        if not hasattr(self, '_cache_backend'):
            if hasattr(django.core.cache, 'caches'):
                self._cache_backend = django.core.cache.caches[_cache_name]
            else:
                self._cache_backend = django.core.cache.get_cache(_cache_name)

        return self._cache_backend
359705
def cached_get(timeout, *params):
    """"""

    def decorator(view_func):
        @wraps(view_func, assigned=available_attrs(view_func))
        def _wrapped_view(view_or_request, *args, **kwargs):

            # The type of the request gets muddled when using a function based
            # decorator. We must use a function based decorator so it can be
            # used in urls.py.
            request = getattr(view_or_request, "request", view_or_request)

            if not hasattr(_thread_locals, "ultracache_request"):
                setattr(_thread_locals, "ultracache_request", request)

            # If request not GET or HEAD never cache
            if request.method.lower() not in ("get", "head"):
                return view_func(view_or_request, *args, **kwargs)

            # If request contains messages never cache
            l = 0
            try:
                l = len(request._messages)
            except (AttributeError, TypeError):
                pass
            if l:
                return view_func(view_or_request, *args, **kwargs)

            # Compute a cache key
            li = [str(view_or_request.__class__), view_func.__name__]

            # request.get_full_path is implicitly added it no other request
            # path is provided. get_full_path includes the querystring and is
            # the more conservative approach but makes it trivially easy for a
            # request to bust through the cache.
            if not set(params).intersection(set((
                "request.get_full_path()", "request.path", "request.path_info"
            ))):
                li.append(request.get_full_path())

            if "django.contrib.sites" in settings.INSTALLED_APPS:
                li.append(get_current_site_pk(request))

            # Pre-sort kwargs
            keys = list(kwargs.keys())
            keys.sort()
            for key in keys:
                li.append("%s,%s" % (key, kwargs[key]))

            # Extend cache key with custom variables
            for param in params:
                if not isinstance(param, str):
                    param = str(param)
                li.append(eval(param))

            s = ":".join([str(l) for l in li])
            hashed = hashlib.md5(s.encode("utf-8")).hexdigest()
            cache_key = "ucache-get-%s" % hashed
            cached = cache.get(cache_key, None)
            if cached is None:
                # The get view as outermost caller may bluntly set _ultracache
                request._ultracache = []
                response = view_func(view_or_request, *args, **kwargs)
                content = None
                if isinstance(response, TemplateResponse):
                    content = response.render().rendered_content
                elif isinstance(response, HttpResponse):
                    content = response.content
                if content is not None:
                    headers = getattr(response, "_headers", {})
                    cache.set(
                        cache_key,
                        {"content": content, "headers": headers},
                        timeout
                    )
                    cache_meta(request, cache_key)
            else:
                response = HttpResponse(cached["content"])
                # Headers has a non-obvious format
                for k, v in cached["headers"].items():
                    response[v[0]] = v[1]

            return response

        return _wrapped_view
    return decorator
1205897
def cache_page(key_params, timeout='default'):
    
    def decorator_fn(fn):
        d = CachePageDecorator()
        return d.decorate(key_params, timeout, fn)

    return decorator_fn
104057
def get_post(self, slug):
        
        cache_key = self.get_cache_key(post_slug=slug)
        content = cache.get(cache_key)
        if not content:
            post = Post.objects.get(slug=slug)
            content = self._format(post)
            cache_duration = conf.GOSCALE_CACHE_DURATION if post else 1
            cache.set(cache_key, content, cache_duration)
        return content
993498
def get_cache_key(self, offset=0, limit=0, order=None, post_slug=''):
        
        return hashlib.sha1(
            '.'.join([
                str(self._get_data_source_url()),
                str(offset),
                str(limit),
                str(order),
                str(post_slug),
                ])
        ).hexdigest()
740974
def get_cache_stats():
    
    cache_stats = []
    for name, _ in six.iteritems(settings.CACHES):
        cache_backend = caches[name]

        try:
            cache_backend_stats = cache_backend._cache.get_stats()
        except AttributeError:  # this backend doesn't provide stats
            logger.info(
                'The memcached backend "{0}" does not support or '
                'provide stats.'.format(name)
            )
            continue

        for address, stats in cache_backend_stats:
            cache_stats.append(
                {'name': name, 'address': address, 'stats': stats}
            )
    return cache_stats
895666
def get_cache(self, decorated_function, *args, **kwargs):
		
		self.__check(decorated_function, *args, **kwargs)
		if decorated_function in self._storage:
			for i in self._storage[decorated_function]:
				if i['instance']() == args[0]:
					result = i['result'].cache_entry(*args, **kwargs)
					if self.__statistic is True:
						if result.has_value is True:
							self.__cache_hit += 1
						else:
							self.__cache_missed += 1
					return result

		if self.__statistic is True:
			self.__cache_missed += 1

		return WCacheStorage.CacheEntry()
1189192
def get_result(self, decorated_function, *args, **kwargs):
		
		try:
			return self._storage[decorated_function]
		except KeyError as e:
			raise WCacheStorage.CacheMissedException('No cache record found') from e
317946
def get_backend(self, backend=None):
        
        from cryptography.hazmat.backends import default_backend
        return default_backend() if backend is None else backend
1040839
def cache_results(&block)
        return yield unless template_cache_configured? && defined?(@_cache_key)

        if cache_read_on_render?
          fetch_result_from_cache(cache_key, @_cache_options, &block)
        else
          write_result_to_cache(cache_key, @_cache_options, &block)
        end
      end
610049
def set_cache(self, value):
        
        value.update(self.cache)
        return self.cache_backend.set(self.cache_key, value)
198357
def raw_get(self, *raw_args, **raw_kwargs):
        

        args = self.prepare_args(*raw_args)
        kwargs = self.prepare_kwargs(**raw_kwargs)

        key = self.key(*args, **kwargs)

        return self.cache.get(key)
927746
function cacheGet(key, options) {
    if (shouldCache(options)) {
      return;
    }

    if (self.options.cache === 'memory') {
      return self.cache[key];
    }

    return self.options.cache.get(key);
  }
1204304
def get(self, default=None):
        
        d = cache.get(self.key)
        return ((json.loads(d.decode('utf-8')) if self.serialize else d)
                if d is not None
                else default)
310554
def fetch(self):
        '''
        
        '''
        if self._fetched is not None:
            raise RuntimeError('fetch() was called but the previous one has '
                               'not yet been applied. Not supported')
        if self._cache:
            self._fetched = len(self._cache)
        return self._cache[0:self._fetched]
1111238
def get_backend(self, service_id, version_number, name):
		""""""
		content = self._fetch("/service/%s/version/%d/backend/%s" % (service_id, version_number, name))
		return FastlyBackend(self, content)
1123635
function fetchCache(target, cache) {
        var x,
            length = cache.length,
            curr;

        for (x = 0; x < length; x += 1) {
            curr = cache[x];
            if (curr.target === target) {
                return curr.inspect;
            }
        }

        return null;
    }