API Gateway Caching

  • Caching support for API Gateway to reduce numebr of calls to backend.
  • Default TTL is 300 seconds (min: 0, max 3600)
  • Cache are defined per stage
  • Possible to override cache settings per method
  • There is encryption option
  • Capacity is between 0.5 GB to 237 GB

Note: caching is every expensive, only uses in production

Cache invalidation

  • We have the ability to flush the entire cache (invalidate) immediately
    • Client can invalidate using header: Cache-Control: max-age=0 with proper IAM authorization
    • Note: You need to specify the InvalidateCache policy or choose Require Authorisation check box in the console, otherwise everyone can invalidate the API cache Pasted image 20221014221607.png