def backend_cache_page(handler, cache_time=None, cache_name=None):
 if (not cache_time):
  cache_time = settings.CACHE_TIME
 if (not cache_name):
  cache_name = 'default'
 if caching_is_enabled():
  @condition(last_modified_func=partial(calc_last_modified, cache_name=cache_name))
  @cache_control(no_cache=True)
  @cache_page(cache_time, cache=cache_name)
  def backend_cache_page_wrapper_fn(request, *args, **kwargs):
   return handler(request, *args, **kwargs)
 else:
  def backend_cache_page_wrapper_fn(request, *args, **kwargs):
   return handler(request, *args, **kwargs)
 return backend_cache_page_wrapper_fn

def backend_cache_page ( handler , cache_time = None , cache_name = None ) : if ( not cache_time ) : cache_time = settings . CACHE_TIME if ( not cache_name ) : cache_name = 'default' if caching_is_enabled ( ) : @ condition ( last_modified_func = partial ( calc_last_modified , cache_name = cache_name ) ) @ cache_control ( no_cache = True ) @ cache_page ( cache_time , cache = cache_name ) def backend_cache_page_wrapper_fn ( request , * args , ** kwargs ) : return handler ( request , * args , ** kwargs ) else : def backend_cache_page_wrapper_fn ( request , * args , ** kwargs ) : return handler ( request , * args , ** kwargs ) return backend_cache_page_wrapper_fn
applies all logic for getting a page to cache in our backend .