Caching in Actions

I have the same need. The use case is to call custom API from auth0 action.

1 Like

Really disappointed that caching isn’t available in Actions like in Rules. Back to rules I suppose.

2 Likes

This seems like a fundamentally missing feature from actions. With token caching being recommended across Auth0 documentation, it seems like a complete oversight to not support it in the platform itself, especially when there’s a big warning on the top of the Rules page, which would be the cacheable alternative.

2 Likes

Hi all, I moved these requests to their own feedback item specific for a caching mechanism in Actions.

On this front, our team is actively investigating a solution for this. Stay tuned for more info.

I have the same need!
Is there a way to cache on auth0 actions?

Hi folks, this feature is now live!

Read more here: Actions Caching Is Now Available

1 Like

According to this article (Actions Limitations), the overall cache size is 8192 bytes. It means that not too many tokens can be stored there. Could you also provide a working sample of an Action that implements this feature?

@dominik.wloadarz, we are working on an example FAQ. We can post it here when it is published.

cc: @tyf

1 Like

@dominik.wloadarz Here’s an FAQ with a rudimentary example:

Note that you also have the ability to remove tokens from cache with api.cache.delete(key) - See documentation here:

1 Like

According to the implementation it seems that one would be capable of storing maybe up to 8 tokens (assumption 1 jwt == 1kB) and that’s it (action limitations → 8kB of cache). So in a M2M scenario 1 API would be able to use up to 8 clients?

1 Like

Agreed - this seems like a big limitation considering the use case it is supposed to be addressing.

@dominik.wloadarz @ryan.fielding,

Thanks for the feedback. Are you running into issues with the cache size limits in practice? The cache is ephemeral, so it may not be holding all those tokens at once.

Also, could you please expand on the following use case?

According to the documentation action cache only persists 15 minutes. M2M tokens usually are valid for much longer (12-24 hours), let’s say I want to limit each client to 5 m2m token requests per day, action cache still can’t help me achieve that.

Thanks for expanding.

This feature addresses token requests on every individual action execution and brings parity to the existing token cache feature in our legacy solution, Rules. You are correct, it will not provide a long-lived cache.

Thanks for the response Dan. Are there any plans on the dev roadmap to provide built-in solutions for auth0 users to control m2m requests on finer scale (per application)? It always makes us nervous knowing someone may put on a loop and exhaust our quota for m2m token requests

@jhu7

There is a request for it here: Add rate limiting and cache for m2m token authentication endpoints

Feel free to add context to that thread.

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