Deleting a cache key

Using the official SDK is the recommended way to write to a cache key.

Deleting a cache key using the SDK

DELETE
https://{your-project-name}.api.fireboost.io/v1/cache/delete/{your-cache-key}

use FireboostIO\SDK\CacheManager;
use FireboostIO\SDK\Adapter\SessionAdapter;

// Create a CacheManager instance with default SessionAdapter
$apiKey = 'your-api-key'; // Or set FIREBOOST_API_KEY environment variable
$cacheManager = new CacheManager(new SessionAdapter(), $apiKey);

// Delete data from cache
$cacheManager->deleteCache('your-cache-key');

Writing to a cache key using the the libraries

This solution is ideal if you want to handle resource deletion manually through the API.

Once you have the JWT token, set it in the client and use that client to call the delete endpoint.

DELETE
https://{your-project-name}.api.fireboost.io/v1/cache/delete/{your-cache-key}
use FireboostIO\Model\SetInput;

$jwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6Ik...';

$config = new Configuration();
$config->setAccessToken($jwt);
$config->setApiKeyPrefix('bearer', 'Bearer');
$api = new FireboostIO\Api\FireboostApi(null, $config);

$response = $api->deleteCache('your-cache-key');

Was this page helpful?