Airship\Cabin\Hull\Landing\Ajax::clearCache PHP Method

clearCache() public method

public clearCache ( string $key )
$key string
    public function clearCache(string $key)
    {
        $secret = $this->config('cache-secret');
        if ($secret === null) {
            \Airship\json_response(['status' => 'ERROR', 'message' => 'Cache-clearing secret value not set']);
        }
        if (!\hash_equals($secret, $key)) {
            \Airship\json_response(['status' => 'ERROR', 'message' => 'Invalid cache-clearing secret value']);
        }
        \Airship\clear_cache();
        \Airship\json_response(['status' => 'OK', 'message' => 'Cache cleared!']);
    }