API网关 APIG-配置API的响应缓存:脚本配置示例

时间:2025-02-12 15:14:48

脚本配置示例

{  "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