9.1.0
Added
- Ability to cache single policy #605
Restify allows individual caching at the policy level with specific configurations. To enable this, a contract Cacheable
must be implemented at the policy level, which enforces the use of the cache()
method.
class PostPolicy implements Cacheable
{
public function cache(): ?CarbonInterface
{
return now()->addMinutes();
}
The cache
method is expected to return a CarbonInterface
or null
. If null
is returned, the current policy will NOT
cached.