Home > Enterprise >  Is there a way to confirm if my AWS API Gateway is caching working or not?
Is there a way to confirm if my AWS API Gateway is caching working or not?

Time:02-03

I have API service set up using a serverless framework. I enabled caching for one of my endpoints and cannot confirm if it is caching.

CodePudding user response:

You can check the CacheHitCount and CacheMissCount metrics:

CacheHitCount

The number of requests served from the API cache in a given period.

The Sum statistic represents this metric, namely, the total count of the cache hits in the given period. The Average statistic represents the cache hit rate, namely, the total count of the cache hits divided by the total number of requests during the period. The denominator corresponds to the Count metric (below).

Unit: Count

CacheMissCount

The number of requests served from the backend in a given period, when API caching is enabled. The Sum statistic represents this metric, namely, the total count of the cache misses in the given period. The Average statistic represents the cache miss rate, namely, the total count of the cache misses divided by the total number of requests during the period. The denominator corresponds to the Count metric (below).

Unit: Count

So every Cache Hit represents a request that is not processed by the backend but is served via Api Gateway cache.

CodePudding user response:

What the endpoints does? Call a Lambda function? Btw, you can check if your backend get the request and provide an answer to that, if is a Lambda you can go to check the logs (cloudwatch) or also in the API Gateway dashboard you can see the flow of API.

You can also enable XRay to trace all request if you want more details on any operation.

Let me know if i can help, i am pretty new too but I do as I can.

  •  Tags:  
  • Related