Skip to content

Commit

Permalink
Set default cache expiration time to 10 minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyjames authored and joshcanhelp committed Feb 6, 2020
1 parent 84d4260 commit a001e25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Jwk jwk = provider.get("{kid of the signing key}"); //throws Exception when not

`GuavaCachedJwkProvider` cache the jwk in a LRU in memory cache, if the jwk is not found in the cache it will ask another provider for it and store it's result in the cache.

> By default it stores 5 keys for 10 hours but these values can be changed
> By default it stores 5 keys for 10 minutes, but these values can be changed.
```java
JwkProvider http = new UrlJwkProvider("https://samples.auth0.com/");
Expand All @@ -77,7 +77,7 @@ Jwk jwk = provider.get("{kid of the signing key}"); //throws Exception when not

`RateLimitJwkProvider` will limit the amounts of different signing keys to get in a given time frame.

> By default the rate is limited to 10 different keys per minute but these values can be changed
> By default the rate is limited to 10 different keys per minute but these values can be changed.
```java
JwkProvider url = new UrlJwkProvider("https://samples.auth0.com/");
Expand All @@ -96,7 +96,7 @@ JwkProvider provider = new JwkProviderBuilder("https://samples.auth0.com/")
Jwk jwk = provider.get("{kid of the signing key}"); //throws Exception when not found or can't get one
```

and specifying cache and rate limit attributes
and specifying cache and rate limit attributes:

```java
JwkProvider provider = new JwkProviderBuilder("https://samples.auth0.com/")
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/auth0/jwk/GuavaCachedJwkProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class GuavaCachedJwkProvider implements JwkProvider {
* @param provider fallback provider to use when jwk is not cached
*/
public GuavaCachedJwkProvider(final JwkProvider provider) {
this(provider, 5, 10, TimeUnit.HOURS);
this(provider, 5, 10, TimeUnit.MINUTES);
}

/**
Expand Down

0 comments on commit a001e25

Please sign in to comment.