Actions Caching Is Now Available

Reduce development overhead and improve performance while storing more artifacts.
Read more…

:writing_hand:t2: Brought to you by Alexa Jacky and Oliver Wang

3 Likes

Got any questions regarding the article?

Any guidance on how the access_token for Auth0 Management API could be stored in the cache? I’m using the node package auth0 and the ManagementClient.

1 Like

Great question @wdorsett! I’ve reached out internally to see how to go about caching using the ManagementClient :thinking:

Hello. Any guidance here please?

Hello Wenham, Happy to assist with your question from Auth0.

What is cached in access_token can vary depending on instances of the cache and use case. You can check our detailed guidance on Docs to help get you started. Currently caching is not readable or writable via APIv2.

Let me know if you have other questions, Thanks!

According to Actions Limitations the cache size is only 8kB overall. How does that solve the token limit issue? Could you provide a sample how to implement and Action with this feature?

Hey there @wdorsett please see the following FAQ for a basic example using the new caching functionality with the Management Client:

Thank you for the article on caching in actions, as well as the suggestion on how to use it when using the auth0.ManagementClient, it was very useful.

Would it be possible to share a M2M token between a Post User Registration action using the auth0.AuthenticationClient and a Post Change Password action using auth0.ManagementClient, using actions caching ?

Is there a way to get the underlying auth0.AuthenticationClient’s token and cache it to be reused in another action using the auth0.ManagementClient ?

Here is my scenario:

  • I have a Post User Registration action that uses auth0.AuthenticationClient(…).requestChangePasswordEmail(…) to send a change password email to the user.
  • I have a Post Change Password action that uses auth0.ManagementClient(…).getUser() to get a user’s metadata.

Both actions are using the same Application’s clientId, clientSecret and domain to instantiate the auth0.AuthenticationClient and auth0.ManagementClient.

Hi Dominik

Thanks for reaching out. We build Actions token size based on common practice and use case, centred around practice to ensure Actions performance and limit relevant latency. For now, we have keep the cumulative size of cached keys and their values must not exceed 8192 bytes.

If you have additional use case on increasing size, feel free to share with me.

At Auth0 Doc we provided examples on using Actions caching, and Actions editor also provide real time editing hit for using caching.

Hi Reynier

Thanks for reaching out, currently we are not supporting cross trigger Actions caching. However, this is an identified feature we’ve had on the roadmap.

We acknowledge the value of it and want to hear more of the scenario e. Can you tell me more about the use case, what is the business need and how this cache help? Also, Can you share what M2M tokens you are looking to cache, the size and frequency of the caching?

Thank you!

For anyone coming across this hoping to store your access tokens this way (m2m token caching being the given example) check this thread out: Caching M2M access token in Actions - #3 by rueben.tiow

TLDR:

Cache keys have a maximum size of 64 bytes and values have a maximum size of 2048 bytes

Which means that they can’t be used for caching tokens unless you split the token up. Was this use-case tested before the feature was rolled out and marketed?