Function __global->web_client_may_use_static_cache

Definitions

sources/global2.php

  • Find if the current web client can use the static cache.This doesn't do checks to see if the whole web request is cachable (see can_static_cache_request), just the web client.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: bool

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$early_boot_check boolean No No False N/A N/A Whether this is an check before the user subsystem is initiated (stricter conditions, but good to detect early)
&$mode ?integer Yes No Null N/A N/A A STATIC_CACHE__* constant (null: not yet set)
&$reason ?string Yes No Null N/A N/A Reason for a false result (null: not yet set)
$consider_failover_mode boolean No No False N/A N/A Whether to consider potential of cache being needed for failover mode

Returns

  • Whether the web client can use static caching
  • Type: boolean
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Find if the current web client can use the static cache.This doesn't do checks to see if the whole web request is cachable (see can_static_cache_request), just the web client.
 *
 * @param  boolean $early_boot_check Whether this is an check before the user subsystem is initiated (stricter conditions, but good to detect early)
 * @param  ?integer $mode A STATIC_CACHE__* constant (null: not yet set)
 * @param  ?string $reason Reason for a false result (null: not yet set)
 * @param  boolean $consider_failover_mode Whether to consider potential of cache being needed for failover mode
 * @return boolean Whether the web client can use static caching
 */

function web_client_may_use_static_cache(bool $early_boot_check = false, ?int &$mode = null, ?string &$reason = null, bool $consider_failover_mode = false) : bool