public static function getNamespace()
wild |
private static function newStackFromCaches($caches)
array | $caches |
wild |
public static function getRequestCache()
Get a request cache stack.
This cache stack is destroyed after each logical request. In particular, it is destroyed periodically by the daemons, while static caches are not.
PhutilKeyValueCacheStack | Request cache stack. |
public static function destroyRequestCache()
Destroy the request cache.
This is called at the beginning of each logical request.
void |
public static function getImmutableCache()
Gets an immutable cache stack.
This stack trades mutability away for improved performance. Normally, it is APC + DB.
In the general case with multiple web frontends, this stack can not be cleared, so it is only appropriate for use if the value of a given key is permanent and immutable.
PhutilKeyValueCacheStack | Best immutable stack available. |
private static function buildImmutableCaches()
Build the immutable cache stack.
list<PhutilKeyValueCache> | List of caches. |
public static function getMutableCache()
wild |
private static function buildMutableCaches()
wild |
public static function getMutableStructureCache()
wild |
private static function buildMutableStructureCaches()
wild |
public static function getRuntimeCache()
Get a runtime cache stack.
This stack is just APC. It's fast, it's effectively immutable, and it gets thrown away when the webserver restarts.
This cache is suitable for deriving runtime caches, like a map of Conduit method names to provider classes.
PhutilKeyValueCacheStack | Best runtime stack available. |
private static function buildRuntimeCaches()
wild |
public static function getRepositoryGraphL1Cache()
wild |
private static function buildRepositoryGraphL1Caches()
wild |
public static function getRepositoryGraphL2Cache()
wild |
private static function buildRepositoryGraphL2Caches()
wild |
public static function getServerStateCache()
Highly specialized cache for storing server process state.
We use this cache to track initial steps in the setup phase, before configuration is loaded.
This cache does NOT use the cache namespace (it must be accessed before we build configuration), and is global across all instances on the host.
PhutilKeyValueCacheStack | Best available server state cache stack. |
public static function getSetupCache()
Highly specialized cache for performing setup checks. We use this cache to determine if we need to run expensive setup checks when the page loads. Without it, we would need to run these checks every time.
Normally, this cache is just APC. In the absence of APC, this cache degrades into a slow, quirky on-disk cache.
PhutilKeyValueCacheStack | Most qualified available cache stack. |
private static function buildSetupCaches($cache_name)
$cache_name |
wild |
private static function getSetupCacheDiskCachePath($name)
$name |
wild |
private static function testTemporaryDirectory($dir)
$dir |
wild |
private static function addProfilerToCaches($caches)
array | $caches |
wild |
private static function addNamespaceToCaches($caches)
array | $caches |
wild |
public static function maybeDeflateData($value)
Deflate a value, if deflation is available and has an impact.
If the value is larger than 1KB, we have gzdeflate(), we successfully can deflate it, and it benefits from deflation, we deflate it. Otherwise we leave it as-is.
Data can later be inflated with inflateData().
string | $value | String to attempt to deflate. |
string|null | Deflated string, or null if it was not deflated. |
public static function inflateData($value)
Inflate data previously deflated by maybeDeflateData().
string | $value | Deflated data, from @{method:maybeDeflateData}. |
string | Original, uncompressed data. |