# Feedback on Caching JWKS for JWT Verification in Ruby

**URL:** <https://community.auth0.com/t/feedback-on-caching-jwks-for-jwt-verification-in-ruby/138885>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [July 15, 2024, 5:39am UTC](https://community.auth0.com/t/feedback-on-caching-jwks-for-jwt-verification-in-ruby/138885 "2024-07-15T05:39:19Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 15, 2024, 5:53pm UTC](https://community.auth0.com/t/feedback-on-caching-jwks-for-jwt-verification-in-ruby/138885/3 "2024-07-15T17:53:20Z")

</div>

Hey @raphael.egeley welcome to the community!

> [@raphael.egeley](#):
>
> After further reading on [how to locate JSON Web Key Sets](https://auth0.com/docs/secure/tokens/json-web-tokens/locate-json-web-key-sets), I decided to enhance the efficiency of the process by implementing caching. This way, I avoid performing an HTTP request to Auth0 for each token verification.

Great Idea! Overall, I think your approach is good - There isn’t a recommended time to cache tokens. The following post expands on caching JWKs and is still useful despite being a few years old.

> [@Caching JWKS signing key](https://community.auth0.com/t/caching-jwks-signing-key/17654/2):
>
> Hi @benji. (This response was updated on April 2021 to reflect signing keys rotation and updated guidance on caching). Auth0 nows support signing key rotation initiated by tenant admins (see [Signing Keys](https://auth0.com/docs/tokens/manage-signing-keys) for details). A tenant’s JWKS resource will have the current key and the “next” key, so applications that prepare in advance for a key rotation. The JWKS resource will return the same set of keys most of the time. Applications should cache these resources, but they also need to be prepared to…

---

_[View the full topic](https://community.auth0.com/t/feedback-on-caching-jwks-for-jwt-verification-in-ruby/138885)._
