PHP Class batcache, batcache

Mostra file Open project: Automattic/batcache Class Usage Examples

Public Properties

Property Type Description
$cache_control Set false to hide the batcache info
$cache_redirects Add headers here as name=>value or name=>array(values). These will be sent with every response from the cache.
$cancel Set false to disable Last-Modified and Cache-Control headers
$debug These headers will never be cached. Apply strtolower.
$do
$genlock
$group ..in this many seconds (zero to ignore this and use batcache immediately)
$headers Array of functions for create_function. The return value is added to $unique above.
$max_age This is the base configuration. You can edit these variables or move them into your wp-config.php file.
$noskip_cookies Change this to cancel the output buffer. Use batcache_cancel();
$query Names of cookies - if they exist and the cache would normally be bypassed, don't bypass it
$redirect_location This is set to the response code during a redirect.
$redirect_status Set true to enable redirect caching.
$remote Expire batcache items aged this many seconds (zero to disable batcache)
$seconds .. (two or more)
$times Zero disables sending buffers to remote datacenters (req/sec is never sent)
$uncached_headers Is it ok to return stale cached response when updating the cache?
$unique Name of memcached group. You can simulate a cache flush by changing this.
$use_stale This is set to the redirect location.
$vary If you conditionally serve different content, put the variable values here.

Public Methods

Method Description
__construct ( $settings )
add_debug_from_cache ( )
add_debug_html_to_output ( $debug_html )
add_debug_just_cached ( )
add_variant ( $function )
configure_groups ( )
do_headers ( $headers1, $headers2 = [] )
do_variants ( $dimensions = false )
generate_keys ( )
is_ssl ( )
ob ( $output )
redirect_status ( $status, $location )
status_header ( $status_header, $status_code )
timer_stop ( $display, $precision = 3 ) Defined here because timer_stop() calls number_format_i18n()

Method Details

__construct() public method

public __construct ( $settings )

add_debug_from_cache() public method

add_debug_html_to_output() public method

public add_debug_html_to_output ( $debug_html )

add_debug_just_cached() public method

add_variant() public method

public add_variant ( $function )

configure_groups() public method

public configure_groups ( )

do_headers() public method

public do_headers ( $headers1, $headers2 = [] )

do_variants() public method

public do_variants ( $dimensions = false )

generate_keys() public method

public generate_keys ( )

is_ssl() public method

public is_ssl ( )

ob() public method

public ob ( $output )

redirect_status() public method

public redirect_status ( $status, $location )

status_header() public method

public status_header ( $status_header, $status_code )

timer_stop() public method

Defined here because timer_stop() calls number_format_i18n()
public timer_stop ( $display, $precision = 3 )

Property Details

$cache_control public_oe property

Set false to hide the batcache info
public $cache_control

$cache_redirects public_oe property

Add headers here as name=>value or name=>array(values). These will be sent with every response from the cache.
public $cache_redirects

$cancel public_oe property

Set false to disable Last-Modified and Cache-Control headers
public $cancel

$debug public_oe property

These headers will never be cached. Apply strtolower.
public $debug

$do public_oe property

public $do

$genlock public_oe property

public $genlock

$group public_oe property

..in this many seconds (zero to ignore this and use batcache immediately)
public $group

$headers public_oe property

Array of functions for create_function. The return value is added to $unique above.
public $headers

$max_age public_oe property

This is the base configuration. You can edit these variables or move them into your wp-config.php file.
public $max_age

$noskip_cookies public_oe property

Change this to cancel the output buffer. Use batcache_cancel();
public $noskip_cookies

$query public_oe property

Names of cookies - if they exist and the cache would normally be bypassed, don't bypass it
public $query

$redirect_location public_oe property

This is set to the response code during a redirect.
public $redirect_location

$redirect_status public_oe property

Set true to enable redirect caching.
public $redirect_status

$remote public_oe property

Expire batcache items aged this many seconds (zero to disable batcache)
public $remote

$seconds public_oe property

.. (two or more)
public $seconds

$times public_oe property

Zero disables sending buffers to remote datacenters (req/sec is never sent)
public $times

$uncached_headers public_oe property

Is it ok to return stale cached response when updating the cache?
public $uncached_headers

$unique public_oe property

Name of memcached group. You can simulate a cache flush by changing this.
public $unique

$use_stale public_oe property

This is set to the redirect location.
public $use_stale

$vary public_oe property

If you conditionally serve different content, put the variable values here.
public $vary