WP_Advanced_Cache
in package
Table of Contents
- $cache_dir : mixed
- $cache_enabled : mixed
- $cache_expiry : mixed
- $cache_key : mixed
- $config : mixed
- $is_cacheable : mixed
- __construct() : mixed
- cache_output() : mixed
- Cache the output.
- clear_cache() : mixed
- Clear all cached files.
- clear_url_cache() : mixed
- Clear cache for a specific URL.
- accepts_gzip() : mixed
- Check if client accepts gzip encoding.
- check_cacheability() : void
- Check if the current request can be cached.
- get_cache_file() : mixed
- Get cache file path.
- get_cache_key() : mixed
- Generate cache key based on request.
- has_cookie() : mixed
- Check if a specific cookie pattern exists.
- init() : void
- Initialize the cache system.
- is_gzipped() : mixed
- Check if content is gzipped.
- is_mobile() : mixed
- Detect if request is from mobile device.
- parse_cached_content() : mixed
- Parse cached content to extract headers and HTML.
- serve_cache() : void
- Serve cached content if available.
Properties
$cache_dir
private
mixed
$cache_dir
$cache_enabled
private
mixed
$cache_enabled
= \true
$cache_expiry
private
mixed
$cache_expiry
= 3600
$cache_key
private
mixed
$cache_key
$config
private
mixed
$config
= ['cache_path' => \WP_CONTENT_DIR . '/cache/advanced-cache/', 'cache_expiry' => 3600, 'enable_mobile_cache' => \true, 'enable_gzip' => \true, 'exclude_cookies' => ['wordpress_logged_in', 'comment_author'], 'exclude_query_strings' => ['s', 'p', 'preview'], 'cache_methods' => ['GET', 'HEAD']]
$is_cacheable
private
mixed
$is_cacheable
= \true
Methods
__construct()
public
__construct() : mixed
Return values
mixed —cache_output()
Cache the output.
public
cache_output(mixed $content) : mixed
Parameters
- $content : mixed
Return values
mixed —clear_cache()
Clear all cached files.
public
static clear_cache() : mixed
Return values
mixed —clear_url_cache()
Clear cache for a specific URL.
public
static clear_url_cache(mixed $url) : mixed
Parameters
- $url : mixed
Return values
mixed —accepts_gzip()
Check if client accepts gzip encoding.
private
accepts_gzip() : mixed
Return values
mixed —check_cacheability()
Check if the current request can be cached.
private
check_cacheability() : void
Return values
void —get_cache_file()
Get cache file path.
private
get_cache_file() : mixed
Return values
mixed —get_cache_key()
Generate cache key based on request.
private
get_cache_key() : mixed
Return values
mixed —has_cookie()
Check if a specific cookie pattern exists.
private
has_cookie(mixed $cookie_pattern) : mixed
Parameters
- $cookie_pattern : mixed
Return values
mixed —init()
Initialize the cache system.
private
init() : void
Return values
void —is_gzipped()
Check if content is gzipped.
private
is_gzipped(mixed $content) : mixed
Parameters
- $content : mixed
Return values
mixed —is_mobile()
Detect if request is from mobile device.
private
is_mobile() : mixed
Return values
mixed —parse_cached_content()
Parse cached content to extract headers and HTML.
private
parse_cached_content(mixed $content) : mixed
Parameters
- $content : mixed
Return values
mixed —serve_cache()
Serve cached content if available.
private
serve_cache() : void