Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: plugins:proxy_cache, GET ,apisix-cache-status return,but POST not. #4776

Closed
zhangdadan opened this issue Aug 8, 2021 · 6 comments
Closed

Comments

@zhangdadan
Copy link

apisix:v2.8
plugins:proxy_cache
my conf:
"plugins": { "proxy-cache": { "cache_method": [ "POST", "GET" ], "disable": false, "hide_cache_headers": true } },
I print ngx.var find that GET upstream_cache_status has value,but POST not at file /usr/local/apisix/apisix/plugins/proxy-cache.lua

What's wrong?

@tokers
Copy link
Contributor

tokers commented Aug 9, 2021

@zhangdadan Thank for your report, it seems there is a bug in the proxy-cache plugin, the cache_method setting doesn't affect the underlying proxy_cache_methods directive.

@zhangdadan
Copy link
Author

zhangdadan commented Aug 9, 2021

@zhangdadan Thank for your report, it seems there is a bug in the proxy-cache plugin, the cache_method setting doesn't affect the underlying proxy_cache_methods directive.

image

I find proxy_cache_methods is not dynamic at /usr/local/apisix/conf/nginx.conf,can it be configured?

@tokers
Copy link
Contributor

tokers commented Aug 9, 2021

@zhangdadan Thank for your report, it seems there is a bug in the proxy-cache plugin, the cache_method setting doesn't affect the underlying proxy_cache_methods directive.

image

I find proxy_cache_methods is not dynamic at /usr/local/apisix/conf/nginx.conf,can it be configured?

Currently it's not dynamic, and cannot be extended by the plugin configuration.

@zhangdadan
Copy link
Author

@zhangdadan Thank for your report, it seems there is a bug in the proxy-cache plugin, the cache_method setting doesn't affect the underlying proxy_cache_methods directive.

image
I find proxy_cache_methods is not dynamic at /usr/local/apisix/conf/nginx.conf,can it be configured?

Currently it's not dynamic, and cannot be extended by the plugin configuration.

But,I has configured by myself and add POST value on proxy_cache_methods at the /usr/local/apisix/conf/nginx.conf,then run apisix restart, but it's not useful.

@tzssangglass
Copy link
Member

You can try the configuration here:

proxy_cache_methods GET HEAD;

@zhangdadan
Copy link
Author

You can try the configuration here:

proxy_cache_methods GET HEAD;

Thanks,it' useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants