Caching
The sttp-oauth2 library comes with CachingAccessTokenProvider and CachingTokenIntrospection - interfaces that allow caching the responses provided by the OAuth2 provider. Both of those require an implementation of the ExpiringCache algebra, defined as follows: 
As the user of the library you can either choose to implement your own cache mechanism, or go for one of the provided:
| Class | Description | Import module | 
|---|---|---|
| ZioRefExpiringCache | Simple ZIO Ref based implementation. Good enough for CachingAccessTokenProvider, but  forCachingTokenIntrospectionit's recommended to use an instance which better handles memory (this instance does not periodically remove expired entries) | "org.polyvariant" %% "sttp-oauth2-cache-zio" % "0.20.0" | 
| CatsRefExpiringCache | Simple Cats Effect 3 Ref based implementation. Good enough for CachingAccessTokenProvider, but  forCachingTokenIntrospectionit's recommended to use an instance which better handles memory (this instance does not periodically remove expired entries) | "org.polyvariant" %% "sttp-oauth2-cache-cats" % "0.20.0" | 
| CatsRefExpiringCache | Simple Cats Effect 2 Ref based implementation.  Good enough for CachingAccessTokenProvider, but  forCachingTokenIntrospectionit's recommended to use an instance which better handles memory (this instance does not periodically remove expired entries) | "org.polyvariant" %% "sttp-oauth2-cache-ce2" % "0.20.0" | 
| ScalacacheExpiringCache | Implementation based on https://github.com/cb372/scalacache | "org.polyvariant" %% "sttp-oauth2-cache-scalacache" % "0.20.0" | 
| MonixFutureCache | Future based implementation powered by Monix | "org.polyvariant" %% "sttp-oauth2-cache-future" % "0.20.0" |