Hi Nehali Acharya sorry for the delayed response here. The cache in the code settings refers to the public key values that are hosted by the identity provider at a publicly accessible url. This is usually referenced in the .well-known endpoint as “jwks-uri”. The purpose of setting this cache value is so that the lambda authorizer does not reach out to the “jwks-uri” endpoint to fetch the public signing keys for every token validation check. Instead, it caches those values so that it can validate tokens from the same identity provider without delay due to network latency.
Since this authorizer code is simply NodeJS code that runs in the Lambda execution environment, I’m sorry to say that this authorizer will not be able to help you cache your AWS IAM policies.