Api Gateway cache key parameters - method level vs integration level?

0

Hi, in api gateway with caching enabled, what's the difference to flag "caching" checkbox for a query string parameter at method request level versus integration request request level?

Method request level Method request level

Integration request level Integration request level

In addition, in a proxy type gateway, do we have to flag "caching" checkbox for the default "proxy" path parameter in order to have it included in the caching key?

Enter image description here

1개 답변
0

As mentioned in the document https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html, "When a cached method or integration has parameters, which can take the form of custom headers, URL paths, or query strings, you can use some or all of the parameters to form cache keys. API Gateway can cache the method's responses, depending on the parameter values used." So where you define the cache key will determine at what point will the incoming request be evaluated against the cached keys.

If you have defined a proxy resource only and no other resource in the API, then the settings on the proxy resource will apply on all resources. If there are more specific resources defined, then the settings on those specific resources will apply to those specific resources and the proxy settings will apply to every other resource. To understand how proxy resources work, please take a look at https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-settings-method-request.html under this section "Use a proxy resource to streamline API setup".

profile pictureAWS
전문가
답변함 2년 전
  • Hi Indranil, thank you. But in both the first 2 screenshots I'm inside the "proxy resource" and at GET method definition, I'm not configuring other resources or other methods, so I still have doubts ;) About the necessity to mark as cacheable the proxy path parameter, do you have any hint?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인