0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Manage Cache proxy for Kong Gateway

Posted at

Kong GatewayのProxy Cache pluginを使って、有効なキャッシュを保存したら、レスポンスが大幅に短縮できる見込みです。

一回目のアクセスでキャッシュがまだない(Miss)

❯ http :8000/demo1
HTTP/1.1 200 OK
...
X-Cache-Key: fcc4fd13443bebf109fdad1c8463e9079e7c83783fbf001e5f75f9013977ec41
X-Cache-Status: Miss
X-Kong-Proxy-Latency: 238
X-Kong-Upstream-Latency: 523

二回目のアクセスに有効なキャッシュがある(Hit)から、APIにアクセスする必要がなく、レイテンシが0に

❯ http :8000/demo1
HTTP/1.1 200 OK
...
X-Cache-Key: fcc4fd13443bebf109fdad1c8463e9079e7c83783fbf001e5f75f9013977ec41
X-Cache-Status: Hit
X-Kong-Proxy-Latency: 1
X-Kong-Upstream-Latency: 0

キャッシュはTTL時間を過ぎたらクリアされますが、手動でクリアすることも可能

http DELETE <admin API>/default/proxy-cache/<Plugin ID>/caches/<Cache Key>

全キャッシュをクリアするも可能

http DELETE <admin API>/cache
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?