# API Gateway - Integration request - how to enable Caching?

**URL:** https://forum.serverless.com/t/api-gateway-integration-request-how-to-enable-caching/13239
**Category:** Serverless Framework
**Tags:** api-gateway
**Created:** [November 27, 2020, 1:05pm UTC](https://forum.serverless.com/t/api-gateway-integration-request-how-to-enable-caching/13239 "2020-11-27T13:05:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![artur.zegar](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/artur.zegar/32/4794_2.png) [@artur.zegar](https://forum.serverless.com/u/artur.zegar)
#### Post date: [November 27, 2020, 1:05pm UTC](https://forum.serverless.com/t/api-gateway-integration-request-how-to-enable-caching/13239/1 "2020-11-27T13:05:03Z")

</div>

Dear Serverless, I have API Gateway Proxy configuration in serverless.yml. Stage caching is successfully turned on. But I cannot enable caching on Integration Request -\> Url Path Parameters -\> caching in serverless.yml file. Here is my config (a part):

```
resources:
  Resources:
    ProxyResource:
      Type: AWS::ApiGateway::Resource
      Properties:
        ParentId: !GetAtt ApiGatewayRestApi.RootResourceId
        RestApiId: !Ref ApiGatewayRestApi
        PathPart: '{proxy+}'
    RootMethod:
      Type: AWS::ApiGateway::Method
      Properties:
        ResourceId: !GetAtt ApiGatewayRestApi.RootResourceId
        RestApiId: !Ref ApiGatewayRestApi
        AuthorizationType: NONE
        HttpMethod: ANY
        Integration:
          Type: HTTP_PROXY
          IntegrationHttpMethod: ANY
          Uri: ${self:custom.backendUrls.${self:provider.stage}}
          PassthroughBehavior: WHEN_NO_MATCH
    ProxyMethod:
      Type: AWS::ApiGateway::Method
      Properties:
        ResourceId: !Ref ProxyResource
        RestApiId: !Ref ApiGatewayRestApi
        AuthorizationType: NONE
        HttpMethod: ANY
        RequestParameters:
          method.request.path.proxy: true
        Integration:
          Type: HTTP_PROXY
          IntegrationHttpMethod: ANY
          Uri: ${self:custom.backendUrls.${self:provider.stage}}/{proxy}
          PassthroughBehavior: WHEN_NO_MATCH
          RequestParameters:
            integration.request.path.proxy: 'method.request.path.proxy'
          CacheKeyParameters:
            - method.request.path.proxy

```

This Api Gateway is only proxy. Of course I can deploy it to AWS and enable the caching on Integration request manually, but would like have that fully automatic.  
Thanks for having a look.

---

<div class="post-metadata">

### Author: ![avensis](https://avatars.discourse-cdn.com/v4/letter/a/bb73d2/32.png) [@avensis](https://forum.serverless.com/u/avensis)
#### Post date: [January 11, 2021, 12:36pm UTC](https://forum.serverless.com/t/api-gateway-integration-request-how-to-enable-caching/13239/2 "2021-01-11T12:36:18Z")

</div>

Hi, I also have the same problem, have you found a solution?  
[SHAREit](https://shareit.onl/) [MX Player](https://mxplayer.pro/)
