Sn0rt commented on issue #9226:
URL: https://github.com/apache/apisix/issues/9226#issuecomment-1498360938
## try to fix
### without proxy-cache
```diff
- proxy-mirror # priority: 1010
- - proxy-cache # priority: 1009
+ # - proxy-cache # priority: 1009
- proxy-rewrite # priority: 1008
```
```bash
$ curl http://127.0.0.1:9080/capital -X POST -d '{"country":"foo"}' -v
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 127.0.0.1:9080...
* Connected to 127.0.0.1 (127.0.0.1) port 9080 (#0)
> POST /capital HTTP/1.1
> Host: 127.0.0.1:9080
> User-Agent: curl/7.88.1
> Accept: */*
> Content-Length: 17
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Date: Wed, 05 Apr 2023 14:55:06 GMT
< Server: APISIX/3.2.0
<
* Connection #0 to host 127.0.0.1 left intact
{"result": "hello"}
$ curl http://127.0.0.1:9080/capital -X POST -d '{"country":"foo"}' -v
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 127.0.0.1:9080...
* Connected to 127.0.0.1 (127.0.0.1) port 9080 (#0)
> POST /capital HTTP/1.1
> Host: 127.0.0.1:9080
> User-Agent: curl/7.88.1
> Accept: */*
> Content-Length: 17
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Date: Wed, 05 Apr 2023 14:55:08 GMT
< Server: APISIX/3.2.0
<
* Connection #0 to host 127.0.0.1 left intact
{"result": "hello"}
```
### proxy-cache with low priority
```diff
- body-transformer # priority: 1080
- proxy-mirror # priority: 1010
- proxy-cache # priority: 1009
- proxy-rewrite # priority: 1008
```
```bash
$ curl http://127.0.0.1:9080/capital -X POST -d '{"country":"foo"}' -v
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 127.0.0.1:9080...
* Connected to 127.0.0.1 (127.0.0.1) port 9080 (#0)
> POST /capital HTTP/1.1
> Host: 127.0.0.1:9080
> User-Agent: curl/7.88.1
> Accept: */*
> Content-Length: 17
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Apisix-Cache-Status: MISS
< Date: Wed, 05 Apr 2023 14:56:59 GMT
< Server: APISIX/3.2.0
<
* Connection #0 to host 127.0.0.1 left intact
{"result": "hello"}
$ curl http://127.0.0.1:9080/capital -X POST -d '{"country":"foo"}' -v
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 127.0.0.1:9080...
* Connected to 127.0.0.1 (127.0.0.1) port 9080 (#0)
> POST /capital HTTP/1.1
> Host: 127.0.0.1:9080
> User-Agent: curl/7.88.1
> Accept: */*
> Content-Length: 17
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Transfer-Encoding: chunked
< Connection: keep-alive
< Server: APISIX/3.2.0
< Date: Wed, 05 Apr 2023 14:56:59 GMT
< Age: 1
< Apisix-Cache-Status: HIT
<
* Connection #0 to host 127.0.0.1 left intact
```
### proxy-cache with high priority
```diff
plugins: # plugin list (sorted by priority)
+ - proxy-cache # priority: 24000
- real-ip # priority: 23000
- ai # priority: 22900
- client-control # priority: 22000
```
```shell
$ curl http://127.0.0.1:9080/capital -X POST -d '{"country":"foo"}' -v
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 127.0.0.1:9080...
* Connected to 127.0.0.1 (127.0.0.1) port 9080 (#0)
> POST /capital HTTP/1.1
> Host: 127.0.0.1:9080
> User-Agent: curl/7.88.1
> Accept: */*
> Content-Length: 17
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 200 OK
< Content-Type: application/json; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Apisix-Cache-Status: MISS
< Date: Wed, 05 Apr 2023 14:58:42 GMT
< Server: APISIX/3.2.0
<
* Connection #0 to host 127.0.0.1 left intact
{"result": "hello"}
$ curl http://127.0.0.1:9080/capital -X POST -d '{"country":"foo"}' -v
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 127.0.0.1:9080...
* Connected to 127.0.0.1 (127.0.0.1) port 9080 (#0)
> POST /capital HTTP/1.1
> Host: 127.0.0.1:9080
> User-Agent: curl/7.88.1
> Accept: */*
> Content-Length: 17
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Transfer-Encoding: chunked
< Connection: keep-alive
< Date: Wed, 05 Apr 2023 14:58:42 GMT
< Server: APISIX/3.2.0
< Age: 1
< Apisix-Cache-Status: HIT
<
* Connection #0 to host 127.0.0.1 left intact
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]