Cache theme's tabs HTML for a week. The cache will also be set as expired
after version and type (free/premium) changes, in addition to the week period.

@author Vova Feldman (@svovaf)
@since  1.2.2.7
435699
function _store_tabs_ajax_action() {
            $this->_logger->entrance();

            $this->check_ajax_referer( 'store_tabs' );

            // Init filesystem if not yet initiated.
            WP_Filesystem();

            // Get POST body HTML data.
            global $wp_filesystem;
            $tabs_html = $wp_filesystem->get_contents( "php://input" );

            if ( is_string( $tabs_html ) ) {
                $tabs_html = trim( $tabs_html );
            }

            if ( ! is_string( $tabs_html ) || empty( $tabs_html ) ) {
                self::shoot_ajax_failure();
            }

            $this->_cache->set( 'tabs', $tabs_html, 7 * WP_FS__TIME_24_HOURS_IN_SEC );

            self::shoot_ajax_success();
        }
842620
private function cache()
	{
		if (!$this->cache)
		{
			return false;
		}

		// get developer params to get cache expiration
		if (App::has('component'))
		{
			$developerParams = App::get('component')->params('com_developer');
		}
		else
		{
			$developerParams = new \Hubzero\Config\Registry();
		}
		$cacheExpiration = $developerParams->get('doc_expiration', 720);

		// cache file
		$cacheFile = PATH_APP . DS . 'cache' . DS . 'api' . DS . 'documentation.json';

		// check if we have a cache file 
		if (file_exists($cacheFile))
		{
			// check if its still valid
			$cacheMakeTime = @filemtime($cacheFile);
			if (time() - $cacheExpiration < $cacheMakeTime)
			{
				$this->output = json_decode(file_get_contents($cacheFile), true);
				return true;
			}
		}

		return false;
	}
1354239
protected function _delete_all_cache() {
		$sidebars_widgets = wp_get_sidebars_widgets();
		$sidebars = array_keys( $sidebars_widgets );

		foreach ( $sidebars as $sidebar_id ) {
			if ( ! static::_is_caching_sidebar( $sidebar_id ) ) {
				continue;
			}

			delete_transient( static::get_transient_id( $sidebar_id ) );
		}
	}
623092
function Cacherrr() {
      var expire = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0];
      var exclude = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];

      _classCallCheck(this, Cacherrr);

      // time for cache to expire
      this.expire = expire;
      // array of paths to be excluded from caching
      this.exclude = exclude;
      // cache entries
      this.entries = {};
    }
513944
def theme_lookup(self):
        

        # check cache
        cache_key = 'theme:%s' % self.domain_unsplit
        theme = cache.get(cache_key)
        if theme:
            THEME.value = theme
            return None

        # check database
        if hasattr(self.site, 'themes'):
            try:
                themes = [theme.name for theme in self.site.themes.all()]
                THEME.value = themes[0]
                cache.set(cache_key, THEME.value, 5*60)
            except:
                return False
        return None
984852
private function isCacheUpToDate()
    {
        if (!file_exists($this->cachedFile)) {
            return false;
        }

        $cacheTime = filemtime($this->cachedFile);
        $mTime     = $this->modificationTime();

        return $cacheTime == $mTime;
    }
282864
def ec_cache
      if not cookies[Evercookie.cookie_cache].present?
        render :nothing => true, :status => 304
        return true
      end

      puts "cache value (#{Evercookie.cookie_cache}): #{cookies[Evercookie.cookie_cache]}"

      response.headers["Content-Type"] = "text/html"
      response.headers["Last-Modified"] = "Wed, 30 Jun 2010 21:36:48 GMT"
      response.headers["Expires"] = "Tue, 31 Dec 2030 23:30:45 GMT"
      response.headers["Cache-Control"] = "private, max-age=630720000"

      render text: cookies[Evercookie.cookie_cache]
    end
658723
public function setCacheTTL($hours)
    {
        if (GenericValidator::validateExpirationTime($hours)) {
            $this->cacheTTL = $hours;
            return true;
        }
        return false;
    }
796358
public function cache() {
		if (count($this->args) === 1) {
			if ($this->args[0] === 'webroot') {
				$this->args = ['css', 'js'];
			} elseif ($this->args[0] === 'app') {
				$this->args = array_values($this->caches);
			}
		}
		foreach ($this->args as $key => $val) {
			if (array_key_exists($val, $this->caches)) {
				$this->args[$key] = $this->caches[$val];
			}
		}

		$this->out('Deleting cache files:');

		if (empty($this->args)) {
			$this->_empty(CACHE);
			$this->out('Complete cache dir emptied');
			return;
		}
		foreach ($this->args as $arg) {
			if (in_array($arg, ['css', 'js'])) {
				$this->{$arg}();
				continue;
			}
			if (!is_dir(CACHE . $arg)) {
				$this->err('No cache dir \'' . $arg . '\'');
				continue;
			}
			$this->_empty(CACHE . $arg);
			$this->out('Cache \'' . $arg . '\' deleted');
		}
	}
1133227
public function noCache()
    {
        $header = new Expires('Mon, 26 Jul 1997 05:00:00 GMT');
        $this->addHeader($header);

        $header = new CacheControl('no-cache');
        $this->addHeader($header);

        $header = new Pragma('no-cache');
        $this->addHeader($header);
    }
1151835
function(newTab, oldTab) {
            if (newTab) {
                newTab.set('contentVisible', true);
            }
            if (oldTab) {
                oldTab.set('contentVisible', false);
            }
        }
712042
function() {
            this._styleCache = {};

            // -----------------------------------------------------------------

            this.ua = "";

            this.name = "";
            this.version = "";

            this.majorVersion = 0;
            /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
            this._browserType = "";
            this._browserVersion = "";
            /* BACKWARD-COMPATIBILITY-END (GitHub #1397) */
            this.isIE = false;
            /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
            this._isIE6 = false;
            /* BACKWARD-COMPATIBILITY-END (GitHub #1397) */
            this.isIE7 = false;
            this.isIE8 = false;
            this.isIE9 = false;
            this.isIE10 = false;
            this.isIE11 = false;
            this.isOldIE = false;
            this.isModernIE = false;
            this.isEdge = false;
            this.isFirefox = false;
            /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
            this._isFF = false;
            /* BACKWARD-COMPATIBILITY-END (GitHub #1397) */
            this.isChrome = false;
            this.isSafari = false;
            this.isOpera = false;
            this.isBlackBerryBrowser = false;
            this.isAndroidBrowser = false;
            this.isSafariMobile = false;
            this.isIEMobile = false;
            this.isOperaMobile = false;
            this.isOperaMini = false;
            this.isS60 = false;
            this.isPhantomJS = false;
            this.isOtherBrowser = false;

            this.isWebkit = false;
            this.isGecko = false;

            this.osName = "";
            this.osVersion = "";
            /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
            this._environment = "";
            /* BACKWARD-COMPATIBILITY-END (GitHub #1397) */
            this.isWindows = false;
            this.isMac = false;
            this.isIOS = false;
            this.isAndroid = false;
            this.isWindowsPhone = false;
            this.isBlackBerry = false;
            this.isSymbian = false;
            this.isOtherOS = false;
            /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
            this._isOtherMobile = false;
            /* BACKWARD-COMPATIBILITY-END (GitHub #1397) */

            this.isMobileView = false;
            this.isDesktopView = false;
            /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
            this._DesktopView = false;
            /* BACKWARD-COMPATIBILITY-END (GitHub #1397) */

            /* BACKWARD-COMPATIBILITY-BEGIN (GitHub #1397) */
            this._isPhone = false;
            this._isTablet = false;
            this._deviceName = "";
            /* BACKWARD-COMPATIBILITY-END (GitHub #1397) */
        }
597133
function buildStyleCache() {
	styleCache = {
		width: {},
		height: {},
	};
	var rules;
	for (var i = 0; i < styleSheets.length; i++) {
		if (styleSheets[i].disabled) {
			continue;
		}
		try {
			rules = styleSheets[i].cssRules;
			if (!rules || !rules.length) {
				continue;
			}
		}
		catch(e) {
			continue;
		}
		buildStyleCacheFromRules(rules);
	}
}
622504
public function invalidateBrowserCache() {
        $this->response->headers->set('Cache-Control','nocache, no-store, max-age=0, must-revalidate');
        $this->response->headers->set('Pragma','no-cache');
        $this->response->headers->set('Expires','Fri, 01 Jan 1970 00:00:00 GMT');
    }
295999
def _purge_expired(self):
        
        time_horizon = time.time() - self._keep_time
        new_cache = {}
        for (k, v) in self._cache.items():
            if v.timestamp > time_horizon:
                new_cache[k] = v
        self._cache = new_cache
739366
protected function useCache()
    {
        // Should we use a cached version?
        if ($this->cache && $this->cacheExists()) {
            $this->templateOutput = $this->getCache();
            if ($this->templateOutput !== false) {
                return true;
            }
        }
        return false;
    }
634373
function ExpiresDecorator(cache, config) {
  BaseDecorator.call(this, cache, config, joi.object().keys({
    expiresIn: joi.number().integer().min(0).default(Infinity),
    staleIn: joi.number().integer().min(0).default(Infinity)
  }));
  this.on('set:after', this.setCreatedAt.bind(this));
  this._store = this._getStore();
}