Custom Caching Mechanism
The Descope PHP SDK uses a caching mechanism to store frequently accessed data, like JWKs, for session token validation. By default APCu is used for caching, but if it is not available caching is disabled.
In this case, a custom caching mechanism can be implemented using the CacheInterface
that exists within the SDK.
Custom Caching with CacheInterface
You can provide a custom caching mechanism using CacheInterface
through the SDK. The following methods are supported through the SDK:
get(string $key)
: Retrieve a value by key.set(string $key, $value, int $ttl = 3600): bool
: Store a value with a time-to-live (TTL).delete(string $key): bool
: Remove a value by key.
Here is an example of setup and use of Laravel's cache system with the Descope SDK:
Additional Resources
Was this helpful?