Add @ttl_cache function decorator.