您好,登錄后才能下訂單哦!
本篇內容主要講解“kong插件怎么使用”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓小編來帶大家學習“kong插件怎么使用”吧!
目錄地址 /usr/local/share/lua/5.1/kong/plugins/proxy-cache
curl -i -X POST http://localhost:8001/plugins \--data name=proxy-cache \--data config.content_type="application/json" \--data config.cache_ttl=30 \--data config.strategy=memoryHTTP/1.1 201 CreatedDate: Fri, 31 Jul 2020 08:35:55 GMTContent-Type: application/json; charset=utf-8Connection: keep-aliveAccess-Control-Allow-Origin: *Server: kong/2.1.0Content-Length: 481X-Kong-Admin-Latency: 7{"created_at":1596184555,"id":"12ac84de-7006-46f7-99b9-94a0dec1b706","tags":null,"enabled":true,"protocols":["grpc","grpcs","http","https"],"name":"proxy-cache","consumer":null,"service":null,"route":null,"config":{"request_method":["GET","HEAD"],"cache_control":false,"vary_query_params":null,"storage_ttl":null,"response_code":[200,301,404],"cache_ttl":30,"vary_headers":null,"strategy":"memory","content_type":["application\/json"],"memory":{"dictionary_name":"kong_db_cache"}}
查看緩存
curl -i -X GET http://localhost:8000/mock/requestHTTP/1.1 200 OKContent-Type: application/json; charset=utf-8Content-Length: 891Connection: keep-aliveX-Cache-Key: ea984309dd577124e1f65cde1065f6acX-Cache-Status: BypassServer: CowboyAccess-Control-Allow-Origin: *Access-Control-Allow-Methods: GETAccess-Control-Allow-Headers: host,connection,x-forwarded-for,x-forwarded-proto,x-forwarded-host,x-forwarded-port,x-real-ip,x-forwarded-prefix,user-agent,accept,x-request-id,via,connect-time,x-request-start,total-route-timeAccess-Control-Allow-Credentials: trueX-Powered-By: mockbinVary: Accept, Accept-EncodingEtag: W/"37b-sAIQN2uDDnfjTSxhJVhSJAtiNTU"Date: Fri, 31 Jul 2020 08:37:07 GMTVia: kong/2.1.0X-Kong-Upstream-Status: 200X-Kong-Upstream-Latency: 1256X-Kong-Proxy-Latency: 525Kong-Cloud-Request-ID: 96f8bc4accd38f58265fecccba92eac6X-RateLimit-Remaining-Minute: 4X-RateLimit-Limit-Minute: 5RateLimit-Remaining: 4RateLimit-Limit: 5RateLimit-Reset: 55
刪除緩存
curl -i -X DELETE http://localhost:8001/proxy-cacheHTTP/1.1 204 No ContentDate: Fri, 31 Jul 2020 08:38:58 GMTConnection: keep-aliveAccess-Control-Allow-Origin: *Server: kong/2.1.0X-Kong-Admin-Latency: 4
到此,相信大家對“kong插件怎么使用”有了更深的了解,不妨來實際操作一番吧!這里是億速云網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。