Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the kong plug-in

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to use kong plug-in", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "how to use kong plug-in"!

The requested URL/usr/local/share/lua/5.1/kong/plugins/proxy-cache was not found on this server.

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"}}

view 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

delete the cache

curl -i -X Delete http://localhost:8001/proxy-cacheHTP/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 At this point, I believe that everyone has a deeper understanding of "how to use kong plug-in", so let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report