Api.cache mechanism

Hi,

I’d like to know if when you put something in auth0 cache is tight on the event triggering it or shared across every call?
The point is the following, I need to cache information in a given key but need this key to be isolated from another call and strongly linked to the event which triggered (maybe it’s already the case out of the box but just want to be sure).

So in an action let’s say I put api.cache.set(‘some_key’, dynamic_value_based_on_event) and an event triggers this action, what happen if another event triggers the same action, would the key be shared or not?

If it is shared how can I make sure the key is unique and related to the event id ? I tried that but it didn’t work:

api.cache.set(event.linked_id, some_dynamic_value)

Hi @nicko.glayre,

When using an Action to cache, the data persist across all executions.

(Reference: Actions Triggers: post-login - API Object)

However, be aware that these cached items will persist for a maximum of 15 minutes.

(Reference: Actions Limitations)

Thanks,
Rueben

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