You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/08/12 08:39:54 UTC
[GitHub] [apisix] agile6v opened a new pull request #4814: fix(proxy-cache): keep cache_method same with nginx's proxy_cache_methods
agile6v opened a new pull request #4814:
URL: https://github.com/apache/apisix/pull/4814
### What this PR does / why we need it:
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
Nginx's proxy_cache_methods directive only allows to specify `GET`、`POST` and `HEAD`, so we keep same with Nginx.
#4776
### Pre-submission checklist:
* [x] Did you explain what problem does this PR solve? Or what new features have been added?
* [x] Have you added corresponding test cases?
* [x] Have you modified the corresponding document?
* [x] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first**
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tzssangglass commented on a change in pull request #4814: fix(proxy-cache): keep cache_method same with nginx's proxy_cache_methods
Posted by GitBox <gi...@apache.org>.
tzssangglass commented on a change in pull request #4814:
URL: https://github.com/apache/apisix/pull/4814#discussion_r687833732
##########
File path: apisix/cli/ngx_tpl.lua
##########
@@ -596,7 +596,7 @@ http {
proxy_cache $upstream_cache_zone;
proxy_cache_valid any {% if proxy_cache.cache_ttl then %} {* proxy_cache.cache_ttl *} {% else %} 10s {% end %};
proxy_cache_min_uses 1;
- proxy_cache_methods GET HEAD;
+ proxy_cache_methods GET HEAD POST;
Review comment:
Is it necessary to cache a POST request?
The only I can think of for caching POST requests is that some internal specification forces the consistent use of POST requests……
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] agile6v commented on a change in pull request #4814: fix(proxy-cache): keep cache_method same with nginx's proxy_cache_methods
Posted by GitBox <gi...@apache.org>.
agile6v commented on a change in pull request #4814:
URL: https://github.com/apache/apisix/pull/4814#discussion_r688223869
##########
File path: apisix/cli/ngx_tpl.lua
##########
@@ -596,7 +596,7 @@ http {
proxy_cache $upstream_cache_zone;
proxy_cache_valid any {% if proxy_cache.cache_ttl then %} {* proxy_cache.cache_ttl *} {% else %} 10s {% end %};
proxy_cache_min_uses 1;
- proxy_cache_methods GET HEAD;
+ proxy_cache_methods GET HEAD POST;
Review comment:
> Is it necessary to cache a POST request?
>
> The only I can think of for caching POST requests is that some internal specification forces the consistent use of POST requests……
Yes. This is a very rare scenario. The users don't enable the method on APISIX, it doesn't take effect. If users enable it, they need to know what they are doing.
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers commented on a change in pull request #4814: fix(proxy-cache): keep cache_method same with nginx's proxy_cache_methods
Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #4814:
URL: https://github.com/apache/apisix/pull/4814#discussion_r688183485
##########
File path: apisix/cli/ngx_tpl.lua
##########
@@ -596,7 +596,7 @@ http {
proxy_cache $upstream_cache_zone;
proxy_cache_valid any {% if proxy_cache.cache_ttl then %} {* proxy_cache.cache_ttl *} {% else %} 10s {% end %};
proxy_cache_min_uses 1;
- proxy_cache_methods GET HEAD;
+ proxy_cache_methods GET HEAD POST;
Review comment:
> It doesn't affect the default behavior of APISIX, which means that user can specify the `POST` method on APISIX.
Here you change the Nginx template, without a configurable setting. This is a change for default havior.
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] agile6v commented on a change in pull request #4814: fix(proxy-cache): keep cache_method same with nginx's proxy_cache_methods
Posted by GitBox <gi...@apache.org>.
agile6v commented on a change in pull request #4814:
URL: https://github.com/apache/apisix/pull/4814#discussion_r688226140
##########
File path: apisix/cli/ngx_tpl.lua
##########
@@ -596,7 +596,7 @@ http {
proxy_cache $upstream_cache_zone;
proxy_cache_valid any {% if proxy_cache.cache_ttl then %} {* proxy_cache.cache_ttl *} {% else %} 10s {% end %};
proxy_cache_min_uses 1;
- proxy_cache_methods GET HEAD;
+ proxy_cache_methods GET HEAD POST;
Review comment:
> > It doesn't affect the default behavior of APISIX, which means that user can specify the `POST` method on APISIX.
>
> Here you change the Nginx template, without a configurable setting. This is a change for default havior.
Whether to enable is [here](https://github.com/agile6v/apisix/blob/master/docs/en/latest/plugins/proxy-cache.md) (cache_method)
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] tokers commented on a change in pull request #4814: fix(proxy-cache): keep cache_method same with nginx's proxy_cache_methods
Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #4814:
URL: https://github.com/apache/apisix/pull/4814#discussion_r687644098
##########
File path: apisix/cli/ngx_tpl.lua
##########
@@ -596,7 +596,7 @@ http {
proxy_cache $upstream_cache_zone;
proxy_cache_valid any {% if proxy_cache.cache_ttl then %} {* proxy_cache.cache_ttl *} {% else %} 10s {% end %};
proxy_cache_min_uses 1;
- proxy_cache_methods GET HEAD;
+ proxy_cache_methods GET HEAD POST;
Review comment:
Nginx by default doesn't enable the cache for POST. Why change this behavior here?
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] spacewander merged pull request #4814: fix(proxy-cache): keep cache_method same with nginx's proxy_cache_methods
Posted by GitBox <gi...@apache.org>.
spacewander merged pull request #4814:
URL: https://github.com/apache/apisix/pull/4814
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] spacewander commented on a change in pull request #4814: fix(proxy-cache): keep cache_method same with nginx's proxy_cache_methods
Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #4814:
URL: https://github.com/apache/apisix/pull/4814#discussion_r687679347
##########
File path: apisix/cli/ngx_tpl.lua
##########
@@ -596,7 +596,7 @@ http {
proxy_cache $upstream_cache_zone;
proxy_cache_valid any {% if proxy_cache.cache_ttl then %} {* proxy_cache.cache_ttl *} {% else %} 10s {% end %};
proxy_cache_min_uses 1;
- proxy_cache_methods GET HEAD;
+ proxy_cache_methods GET HEAD POST;
Review comment:
@agile6v
Could you sync it to APISIX.pm?
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] agile6v commented on a change in pull request #4814: fix(proxy-cache): keep cache_method same with nginx's proxy_cache_methods
Posted by GitBox <gi...@apache.org>.
agile6v commented on a change in pull request #4814:
URL: https://github.com/apache/apisix/pull/4814#discussion_r688222094
##########
File path: apisix/cli/ngx_tpl.lua
##########
@@ -596,7 +596,7 @@ http {
proxy_cache $upstream_cache_zone;
proxy_cache_valid any {% if proxy_cache.cache_ttl then %} {* proxy_cache.cache_ttl *} {% else %} 10s {% end %};
proxy_cache_min_uses 1;
- proxy_cache_methods GET HEAD;
+ proxy_cache_methods GET HEAD POST;
Review comment:
> @agile6v
> Could you sync it to APISIX.pm?
done
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] agile6v commented on a change in pull request #4814: fix(proxy-cache): keep cache_method same with nginx's proxy_cache_methods
Posted by GitBox <gi...@apache.org>.
agile6v commented on a change in pull request #4814:
URL: https://github.com/apache/apisix/pull/4814#discussion_r687655944
##########
File path: apisix/cli/ngx_tpl.lua
##########
@@ -596,7 +596,7 @@ http {
proxy_cache $upstream_cache_zone;
proxy_cache_valid any {% if proxy_cache.cache_ttl then %} {* proxy_cache.cache_ttl *} {% else %} 10s {% end %};
proxy_cache_min_uses 1;
- proxy_cache_methods GET HEAD;
+ proxy_cache_methods GET HEAD POST;
Review comment:
It doesn't affect the default behavior of APISIX, which means that user can specify the `POST` method on APISIX.
--
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org