API网关 APIG-响应缓存策略说明:脚本配置示例

时间:2024-07-31 09:08:14

脚本配置示例

{
  "cache_key": {
    "system_params": [
      "$context.sourceIp",
      "$context.requestId"
    ],
    "parameters": [
      "demo_parameters"
    ],
    "headers": [
      "demo_header"
    ]
  },
  "cache_http_status_and_ttl": [
    {
      "http_status": [
        200
      ],
      "ttl": 300
    }
  ],
  "client_cache_control": {
    "mode": "apps",
    "datas": [
      "demo_app_id_1,demo_app_id_2"
    ]
  },
  "cacheable_headers": [
    "demo_cacheable_headers_1,demo_cacheable_headers_2"
  ]
}
support.huaweicloud.com/usermanual-apig/apig_03_0111.html