You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment the setCache() only takes a handful of hard coded drivers (filesystem + some popular relational databases). It would be nice to write our own custom driver so we could implement a key/value store or another mechanism like s3.
The text was updated successfully, but these errors were encountered:
Exactly, i agree, at the moment is feasible only with PDO adapter and Filesystem adapter.
This is one of the most candidate features for the next major version, following PSR6/PSR16 and dependency injection.
To be honest, I believe it’s not the responsibility of the API client library to provide built-in caching options. This should be left to the user of the library. There are various caching mechanisms—such as key-value stores, file systems, or cloud storage like S3—and the user should be free to choose the one that best fits their needs.
From a design perspective, this aligns with the Single Responsibility Principle (SRP). The primary role of an API client is to interact with the API, not to manage caching. By trying to implement caching within the client, we would be coupling two distinct concerns—API communication and caching—making the library more complex and less flexible.
Users who need caching can implement it themselves, perhaps by using standardized interfaces like PSR-6 or PSR-16, which are designed specifically for caching in PHP applications. This keeps the library clean and focused on what it should be doing: facilitating API interaction, while giving the user full control over how they manage their caching strategy.
At the moment the
setCache()
only takes a handful of hard coded drivers (filesystem + some popular relational databases). It would be nice to write our own custom driver so we could implement a key/value store or another mechanism like s3.The text was updated successfully, but these errors were encountered: