# Caching of token ins Python SDK

**URL:** <https://community.auth0.com/t/caching-of-token-ins-python-sdk/134160>\
**Category:** Get Help\
**Tags:** auth0-python, sdks-quickstarts\
**Created:** [May 15, 2024, 8:30am UTC](https://community.auth0.com/t/caching-of-token-ins-python-sdk/134160 "2024-05-15T08:30:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![magic\_al](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@magic\_al](https://community.auth0.com/u/magic_al)\
**Post date:** [May 15, 2024, 8:30am UTC](https://community.auth0.com/t/caching-of-token-ins-python-sdk/134160/1 "2024-05-15T08:30:37Z")

</div>

Ready to post? 🔍 First, try searching for your answer.  
I’m using the [client credential flow](https://github.com/auth0/auth0-python/blob/6b1199fc74a8d2fc6655ffeef09ae961dc0b8c37/auth0/authentication/get_token.py#L90) to create a token.

On consecutive calls I always receive the same token.

Is the token cached on client or on server side? I want to prevent calling the server as long as my token is still valid. Is this feature build in the SKD somehow?

Thanks!

---

<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:** [May 15, 2024, 10:31pm UTC](https://community.auth0.com/t/caching-of-token-ins-python-sdk/134160/3 "2024-05-15T22:31:37Z")

</div>

Hey there @magic_al!

> [@magic\_al](#):
>
> On consecutive calls I always receive the same token.

For which call(s) specifically are you receiving the same token?

> [@magic\_al](#):
>
> Is the token cached on client or on server side? I want to prevent calling the server as long as my token is still valid. Is this feature build in the SKD somehow?

I don’t believe the Python SDK provides any sort of caching mechanism - What you could do is check the `exp` and introduce logic to _not_ request a new token if not past the `exp` time.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [June 28, 2024, 8:56pm UTC](https://community.auth0.com/t/caching-of-token-ins-python-sdk/134160/4 "2024-06-28T20:56:40Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
