πCaching Responses
Installation
composer require saloonphp/cache-plugin "^2.0"Configuration
<?php
use Saloon\CachePlugin\Contracts\Driver;
use Saloon\CachePlugin\Traits\HasCaching;
use Saloon\CachePlugin\Contracts\Cacheable;
class GetServersRequest extends Request implements Cacheable
{
use HasCaching;
// ...
public function resolveCacheDriver(): Driver
{
//
}
public function cacheExpiryInSeconds(): int
{
//
}
}Cache Drivers
Expiry
Caching Requests
Checking if a response is cached
When will Saloon cache a request?
Customising the cache key
Invalidating the current cache
Temporarily Disabling Caching
Source Code
Last updated