kong插件怎么使用

本篇内容主要讲解“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插件怎么使用”有了更深的了解,不妨来实际操作一番吧!这里是创新互联网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!


本文题目:kong插件怎么使用
文章出自:http://azwzsj.com/article/gpdgjo.html