Decide if the cache file is sufficient enough to not parse the ids files.
10562
private function _is_cache_worthy()
    {
        $pci_good = true;
        foreach (array_keys($this->_pci_entries) as $vendor) {
            foreach (array_keys($this->_pci_entries[$vendor]) as $dever) {
                if (!isset($this->_existing_cache_vals['hw']['pci'][$vendor][$dever])) {
                    $pci_good = false;
                    break 2;
                }
            }
        }
        $usb_good = true;
        foreach (array_keys($this->_usb_entries) as $vendor) {
            foreach (array_keys($this->_usb_entries[$vendor]) as $dever) {
                if (!isset($this->_existing_cache_vals['hw']['usb'][$vendor][$dever])) {
                    $usb_good = false;
                    break 2;
                }
            }
        }

        return array('pci' => $pci_good, 'usb' => $usb_good);
    }
871973
def should_obfuscate_filename(self):
        """"""

        for pattern in self.args.hide_file_names:
            try:
                compiled = re.compile(pattern, re.IGNORECASE)
                if compiled.search(self.entity):
                    return True
            except re.error as ex:
                log.warning(u('Regex error ({msg}) for hide_file_names pattern: {pattern}').format(
                    msg=u(ex),
                    pattern=u(pattern),
                ))
        return False
464056
def is_cached(file_or_script):
    """"""
    if isinstance(file_or_script, str):
        return unmap_file(file_or_script) in file_cache
    else:
        return is_cached_script(file_or_script)
    return
528657
def invalidate_caches(cls):
        """"""
        for finder in sys.path_importer_cache.values():
            if hasattr(finder, 'invalidate_caches'):
                finder.invalidate_caches()
653901
function ( noPrune ) {
        removeNotFoundFiles();

        noPrune = typeof noPrune === 'undefined' ? true : noPrune;

        var entries = normalizedEntries;
        var keys = Object.keys( entries );

        if ( keys.length === 0 ) {
          return;
        }

        var me = this;

        keys.forEach( function ( entryName ) {
          var cacheEntry = entries[ entryName ];

          try {
            var meta = useChecksum ? me._getMetaForFileUsingCheckSum( cacheEntry ) : me._getMetaForFileUsingMtimeAndSize( cacheEntry );
            cache.setKey( entryName, meta );
          } catch (err) {
            // if the file does not exists we don't save it
            // other errors are just thrown
            if ( err.code !== 'ENOENT' ) {
              throw err;
            }
          }
        } );

        cache.save( noPrune );
      }
781131
private function isCacheValid()
    {
        if (!$this->cacheFile->exists()) {
            return false;
        }

        $cachedConfigTimestamp = $this->cacheFile->getTimestamp();

        /** @var \Bolt\Filesystem\Filesystem $configFs */
        $configFs = $this->app['filesystem']->getFilesystem('config');

        $configFiles = [
            'config.yml',
            'config_local.yml',
            'contenttypes.yml',
            'extensions.yml',
            'menu.yml',
            'permissions.yml',
            'routing.yml',
            'taxonomy.yml',
        ];
        foreach ($configFiles as $configFile) {
            $timestamp = $configFs->has($configFile) ? $configFs->get($configFile)->getTimestamp() : 0;
            if ($timestamp > $cachedConfigTimestamp) {
                // The configuration file timestamp is *newer* than the cache file's … invalidate!
                $this->invalidateCache();

                return false;
            }
        }

        return true;
    }
564538
function checkRequiredFiles() {
  const indexHtmlExists = fse.existsSync(paths.indexHtml);
  const indexJsExists = fse.existsSync(paths.indexJs);

  if (!indexHtmlExists || !indexJsExists) {
    logError('\nSome required files couldn\'t be found. Make sure these all exist:\n');
    logError(`\t- ${paths.indexHtml}`);
    logError(`\t- ${paths.indexJs}\n`);

    process.exit(1);
  }
}
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
908360
function shouldCache(options) {
    options = options || {};
    return (options.hasOwnProperty('cache') && !options.cache) || !self.options.cache;
  }
925928
public function isValid() {
        // TODO: stat-Cache bei wiederholten Aufrufen loeschen, siehe clearstatcache()

        if (file_exists($this->fileName)) {
            if ($this->lastModified !== filemtime($this->fileName))
                return false;
        }
        elseif ($this->lastModified !== null) {
            return false;
        }

        return true;
    }
1078991
static function isNoCacheAdviced()
    {
        if ( !isset( $GLOBALS['eZSiteBasics'] ) )
            return false;
        $siteBasics = $GLOBALS['eZSiteBasics'];
        if ( !isset( $siteBasics['no-cache-adviced'] ) )
            return false;
        return $siteBasics['no-cache-adviced'];
    }
565217
def _ValidateCacheFileMetadataHeader(self, cache_file_metadata_header):
    
    # TODO: add support for format version 2 and 3
    return (
        cache_file_metadata_header.key_size > 0 and
        cache_file_metadata_header.key_size < self._MAXIMUM_URL_LENGTH and
        cache_file_metadata_header.format_version == 1 and
        cache_file_metadata_header.last_fetched_time > 0 and
        cache_file_metadata_header.fetch_count > 0)
804961
def clean!
      files_to_keep = cache.keys.concat(cache.values)

      if (sprockets_manifest = Dir.entries("#{base_dir}").detect { |entry| entry =~ SPROCKETS_MANIFEST_REGEX })
        files_to_keep.concat(JSON.parse(File.read("#{base_dir}/#{sprockets_manifest}")).fetch("files", {}).keys)
      end

      Dir["#{base_dir}/**/*"].each do |path|
        next if File.directory?(path) || files_to_keep.include?(Pathname(path).relative_path_from(base_dir).to_s)

        FileUtils.rm(path)
      end
    end
609179
def is_cached(self, version=None):
        '''
        
        '''
        version = _process_version(self, version)

        if self.api.cache and self.api.cache.fs.isfile(
                self.get_version_path(version)):
            return True

        return False
332340
def CacheFileSystem(self, path_spec, file_system):
    
    identifier = self._GetFileSystemCacheIdentifier(path_spec)
    self._file_system_cache.CacheObject(identifier, file_system)
824275
def _should_cache_target_dir(self, vt):
    """"""
    return (
      self.cache_target_dirs and
      vt.cacheable and
      (not vt.is_incremental or self.cache_incremental) and
      self.artifact_cache_writes_enabled()
    )
633278
function shouldSkip(file, rough) {
  // Basically, if rough, any small change should still process the content
  return rough
    ? file.cache.status === LocalStatus.Unchanged
    : file.content.status === LocalStatus.Unchanged;
}