How do I cache a m2m token in a Auth0 Action

Based on this answer (Caching resources in Actions) and this documentation (Cache Expensive Resources in Rules) it looks like I need to use Rules instead?