tinpad commented on issue #5109:
URL: https://github.com/apache/apisix/issues/5109#issuecomment-924004387
conf.yaml configuration -
proxy_cache:
cache_ttl: 1000s
zones:
- name: disk_cache_one
memory_size: 50m
disk_size: 1G
disk_path: "/tmp/disk_cache_one"
cache_levels: "1:2"
please refer below consecutive executions -
curl http://127.0.0.1:9080/order/list?pageSize=10 -i
HTTP/1.1 200
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 96
Date: Tue, 21 Sep 2021 13:28:50 GMT
Server: APISIX/2.8
X-Request-Id: 0b55cd16-60b1-4170-80d8-81d15c618554
Apisix-Cache-Status: EXPIRED
curl http://127.0.0.1:9080/order/list?pageSize=10 -i
HTTP/1.1 200
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
Date: Tue, 21 Sep 2021 13:28:50 GMT
Server: APISIX/2.8
X-Request-Id: 2814df47-8177-47c6-bb2a-ec6a740abe3b
Apisix-Cache-Status: HIT
curl http://127.0.0.1:9080/order/list?pageSize=10 -i
HTTP/1.1 200
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 94
Date: Tue, 21 Sep 2021 13:28:50 GMT
Server: APISIX/2.8
X-Request-Id: c8903e4a-e45c-48f1-9695-827df576cb55
Apisix-Cache-Status: HIT
curl http://127.0.0.1:9080/order/list?pageSize=10 -i
HTTP/1.1 200
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 93
Date: Tue, 21 Sep 2021 13:28:50 GMT
Server: APISIX/2.8
X-Request-Id: 95ad6997-e2e4-4c36-a0e4-6ac5179c2a8d
Apisix-Cache-Status: HIT
curl http://127.0.0.1:9080/order/list?pageSize=10 -i
HTTP/1.1 200
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 92
Date: Tue, 21 Sep 2021 13:28:50 GMT
Server: APISIX/2.8
X-Request-Id: 0e4e4018-3cb2-4d91-b5a3-3548b9cbe318
Apisix-Cache-Status: HIT
curl http://127.0.0.1:9080/order/list?pageSize=10 -i
HTTP/1.1 200
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 99
Date: Tue, 21 Sep 2021 13:28:50 GMT
Server: APISIX/2.8
X-Request-Id: 34771422-d0ab-4f3b-bd83-696728bb438c
Apisix-Cache-Status: HIT
curl http://127.0.0.1:9080/order/list?pageSize=10 -i
HTTP/1.1 200
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 98
Date: Tue, 21 Sep 2021 13:28:50 GMT
Server: APISIX/2.8
X-Request-Id: 9622559b-7b31-40b7-98a5-562084873143
Apisix-Cache-Status: HIT
curl http://127.0.0.1:9080/order/list?pageSize=10 -i
HTTP/1.1 200
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 97
Date: Tue, 21 Sep 2021 13:28:50 GMT
Server: APISIX/2.8
X-Request-Id: cd78d7c4-bb1c-480f-b70c-1c5207012729
Apisix-Cache-Status: HIT
curl http://127.0.0.1:9080/order/list?pageSize=10 -i
HTTP/1.1 200
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 96
Date: Tue, 21 Sep 2021 13:28:50 GMT
Server: APISIX/2.8
X-Request-Id: f4c2bd6e-22bb-4fa1-b9ac-587164d70644
Apisix-Cache-Status: HIT
curl http://127.0.0.1:9080/order/list?pageSize=10 -i
HTTP/1.1 200
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
Date: Tue, 21 Sep 2021 13:28:50 GMT
Server: APISIX/2.8
X-Request-Id: e8b67bd0-6371-4d0e-b7f4-de5ad521b879
Apisix-Cache-Status: HIT
curl http://127.0.0.1:9080/order/list?pageSize=10 -i
HTTP/1.1 200
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 94
Date: Tue, 21 Sep 2021 13:29:01 GMT
Server: APISIX/2.8
X-Request-Id: bd4485a1-00cd-4524-bb67-10e906c58e08
Apisix-Cache-Status: EXPIRED
Observations-
1. Date header's value in response doesn't change as long as
Apisix-Cache-Status = HIT [Date: Tue, 21 Sep 2021 13:28:50 GMT]
2. Apisix-Cache-Status = HIT for 10 seconds only even if I have configured
it to 1000s in the yaml file.
3. We have also restarted APISIX, ETCD after modifying the yaml file but the
results are still same as above.
Could you please let me know why the cache_ttl value is not picked up by
APISIX.
Is there any other solution for this problem, or let us know if there is any
other configuration we need to update in order to make it work.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]