Checks whether the page is already cached and returns the cached
        version if available.
358186
def process_request(self, request):
        
        if self.cache_anonymous_only:
            assert hasattr(request, 'user'), "The Django cache middleware with CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True requires authentication middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.auth.middleware.AuthenticationMiddleware' before the CacheMiddleware."

        if not request.method in ('GET', 'HEAD') or request.GET:
            request._cache_update_cache = False
            return None # Don't bother checking the cache.

        if self.cache_anonymous_only and request.user.is_authenticated():
            request._cache_update_cache = False
            return None # Don't cache requests from authenticated users.

        cache_key = get_cache_key(request, self.key_prefix)
        if cache_key is None:
            request._cache_update_cache = True
            return None # No cache information available, need to rebuild.

        response = cache.get(cache_key, None)
        if response is None:
            logging.debug("FetchFromCacheMiddleware: %s is %s.  paramters(%s)" % ( cache_key, request.path, get_cache_key_parameters(request)))
            request._cache_update_cache = True
            return None # No cache information available, need to rebuild.
        logging.debug("Found %s -> %s in the cache. parameters(%s)" % (cache_key, request.path, get_cache_key_parameters(request)))
        request._cache_update_cache = False
        return response
1325817
private static boolean hasSiteMapUrl(
		final ServletContext servletContext,
		final HttpServletRequest req,
		final HttpServletResponse resp,
		final SortedSet<View> views,
		final Book book,
		PageRef pageRef
	) throws ServletException, IOException {
		Boolean result = CapturePage.traversePagesAnyOrder(
			servletContext,
			req,
			resp,
			pageRef,
			CaptureLevel.META,
			new CapturePage.PageHandler<Boolean>() {
				@Override
				public Boolean handlePage(Page page) throws ServletException, IOException {
					// TODO: Chance for more concurrency here by view?
					for(View view : views) {
						if(
							view.getAllowRobots(servletContext, req, resp, page)
							&& view.isApplicable(servletContext, req, resp, page)
						) {
							return true;
						}
					}
					return null;
				}
			},
			new CapturePage.TraversalEdges() {
				@Override
				public Set<ChildRef> getEdges(Page page) {
					return page.getChildRefs();
				}
			},
			new CapturePage.EdgeFilter() {
				@Override
				public boolean applyEdge(PageRef childPage) {
					return book.getBookRef().equals(childPage.getBookRef());
				}
			}
		);
		assert result == null || result : "Should always be null or true";
		return result != null;
	}
263258
def get(self, page, version=None):
        
        return (self._dokuwiki.send('wiki.getPageVersion', page, version)
                if version is not None
                else self._dokuwiki.send('wiki.getPage', page))
1161555
function () {
            var url = this.getUrl();
            var pageId = this._cache[url] ? this._cache[url].id : null;
            if (pageId) {
                if (this._navigate) {
                    this.$callback(this._navigate, {
                        pageId : pageId,
                        url : url
                    });
                }
            } else {
                this._addInCache(url, this._lastPageId);
            }
        }
1316455
def page_expired?(page)
      return false if @options[:ttl_page].nil?
      stored_page = @storage.get(page)
      r = stored_page && stored_page.expired?(@options[:ttl_page])
      @logger.debug { "Page #{page.url} marked as expired" } if r
      r
    end
669688
def has_page?(url)
      schemes = %w(http https)
      if schemes.include? url.scheme
        u = url.dup
        return schemes.any? { |s| u.scheme = s; has_key?(u) }
      end

      has_key? url
    end
760206
def _load_cache(self):
        """"""
        # If the cached file exist, read-it
        max_refresh_date = timedelta(days=7)
        cached_data = {}
        try:
            with open(self.cache_file, 'rb') as f:
                cached_data = pickle.load(f)
        except Exception as e:
            logger.debug("Cannot read version from cache file: {} ({})".format(self.cache_file, e))
        else:
            logger.debug("Read version from cache file")
            if (cached_data['installed_version'] != self.installed_version() or
                    datetime.now() - cached_data['refresh_date'] > max_refresh_date):
                # Reset the cache if:
                # - the installed version is different
                # - the refresh_date is > max_refresh_date
                cached_data = {}
        return cached_data
236298
def api_version(self):
        """"""

        now = datetime.utcnow()

        if self.version_cache_timestamp and self.version_cache_timestamp + self.version_cache_timeout > now:
            return self.version_cache_value  # we have a cached value

        self.version_cache_value = self.get_api_version()

        if self.minimum_version and self.version_cache_value < self.minimum_version:
            raise NotSupportedError('%s requires ejabberd >= %s' % (self.__class__.__name__,
                                                                    self.minimum_version))

        self.version_cache_timestamp = now
        return self.version_cache_value
435955
def cache_last_modified(request, *argz, **kwz):
	''''''
	response, site, cachekey = kwz.get('_view_data') or initview(request)
	if not response: return None
	return response[1]
363721
def iscached(self):
        
        if self.mode == 'spark':
            return self.tordd().is_cached
        else:
            notsupported(self.mode)
600403
def isModified(self):
        
        # NOTE: only check content digest if locally cached content is set
        # (content already pulled or new content set); otherwise this
        # results in pulling content down to checksum it !
        return self.info_modified or \
            self._content and self._content_digest() != self.digest
1115517
def server_version(self) -> Version:
        """"""
        if self._server_version_cache is None:
            data = self._client.get("/version")
            self._server_version_cache = Version(data["version"])
        return self._server_version_cache
976375
def check_cache(self, e_tag, match):
        """"""
        if e_tag != match:
            return False
        self.send_response(304)
        self.send_header("ETag", e_tag)
        self.send_header("Cache-Control",
                         "max-age={0}".format(self.server.max_age))
        self.end_headers()
        thread_local.size = 0
        return True
1029979
def should_cache(self, request, response):
        

        if not getattr(request, '_cache_update_cache', False):
            return False
        if not response.status_code in getattr(settings, 'BETTERCACHE_CACHEABLE_STATUS', CACHEABLE_STATUS):
            return False
        if getattr(settings, 'BETTERCACHE_ANONYMOUS_ONLY', False) and self.session_accessed and request.user.is_authenticated:
            return False
        if self.has_uncacheable_headers(response):
            return False
        return True
987415
public function isCached() {
    $cache = ObjectFactory::getInstance('staticCache');
    return $this->id == self::NO_CACHE ? false :
            $cache->exists(self::getCacheSection($this->type), self::getCacheId($this->id));
  }
106079
public function checkPageCache(\Concrete\Core\Http\Request $request)
    {
        $library = PageCache::getLibrary();
        if ($library->shouldCheckCache($request)) {
            $record = $library->getRecord($request);
            if ($record instanceof PageCacheRecord) {
                if ($record->validate($request)) {
                    return $library->deliver($record);
                }
            }
        }

        return false;
    }
1116041
def page_crawled(self, page_resp):
        
        page_text = utils.parse_text(page_resp)
        page_hash = utils.hash_text(''.join(page_text))
        if page_hash not in self.page_cache:
            utils.cache_page(self.page_cache, page_hash, self.args['cache_size'])
            return False
        return True