kong插件怎么使用

发布时间:2021-12-17 14:38:49 作者:iii
来源:亿速云 阅读:341

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

推荐阅读:
  1. Kong 的集群怎么用
  2. Kong 介绍

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

kong

上一篇:如何排查rocketmq错误迁移导致的问题

下一篇:如何进行springboot配置templates直接访问的实现

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》