From c603ea4d3d52debf211fe3514ac7d35b9a1a38e4 Mon Sep 17 00:00:00 2001 From: Vu Tran Date: Fri, 9 Sep 2022 17:06:27 +0700 Subject: [PATCH] [Core][Api] - set TTL for caching my api method #223 --- apps/api/jobs/ApiAction.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/api/jobs/ApiAction.lua b/apps/api/jobs/ApiAction.lua index 72edbc5..e66e118 100644 --- a/apps/api/jobs/ApiAction.lua +++ b/apps/api/jobs/ApiAction.lua @@ -64,6 +64,9 @@ upstream upstream_ws_${api_key} { ${entrypoints/_upstream_ws()} include /massbit/massbitroute/app/src/sites/services/gateway/etc/_upstream_server_ws.conf; } +]], + _api_method_provider = [[ + add_header X-Accel-Expires $http_x_mbr_method_ttl; ]], _api_method1 = "", _api_method = [[ @@ -186,7 +189,7 @@ server { server { listen unix:/tmp/${server_name}.sock; location / { - ${_api_method1()} + ${_api_method_provider()} proxy_pass http://${blockchain}-${network}.node.mbr.]] .. _domain_name .. [[;