RSSCache::check_cache() WordPress Method

The RSSCache::check_cache() method is used to check if an RSS feed is cached and, if so, return the cached data. This is useful for performance reasons, as retrieving data from a cache is typically faster than fetching it from the original source. The method takes two arguments: the first is the URL of the RSS feed, and the second is the cache expiration time (in seconds). If the cache has expired, the method will return false. Otherwise, it will return the cached data.

RSSCache::check_cache( $url ) #


Source

File: wp-includes/rss.php

	function check_cache ( $url ) {
		$this->ERROR = "";
		$cache_option = 'rss_' . $this->file_name( $url );

		if ( get_transient($cache_option) ) {
			// object exists and is current
				return 'HIT';
		} else {
			// object does not exist
			return 'MISS';
		}
	}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.