hahait commented on issue #12834:
URL: https://github.com/apache/apisix/issues/12834#issuecomment-3692042745
## The configuration steps of the proxy-cache plugin are as follows:
1. The configuration of proxy-cache is predefined in apisix config.yaml as
follows
```
apisix:
……
proxy_cache:
cache_ttl: 60s
zones:
- name: disk_cache_img
memory_size: 500m
disk_size: 10G
disk_path: /tmp/disk_cache_img
cache_levels: "1:2"
- name: disk_cache_mixed
memory_size: 500m
disk_size: 10G
disk_path: /tmp/disk_cache_mixed
cache_levels: "1:2"
```
2. Add the proxy-cache plugin to the global plugin of apisix dashboard. The
content of the plugin is as follows. Only added, Configuration hasn't started
yet
```
{
"_meta": {
"disable": true
}
}
```
3. The plugin content is normally written to etcd. The content of the
proxy-cache plugin in etcd is as follows
`"proxy-cache":{"_meta":{"disable":true}}`
4. After adding the proxy-cache plugin, error logs began to appear in the
error log of apisix
```
[error] 52#52: *18 [lua] config_etcd.lua:679: sync_data(): failed to check
item data of [/apisix/global_rules] err:failed to check the configuration of
plugin proxy-cache err: cache_zone disk_cache_one not found ,val:
{"create_time":1756174355,"id":"1","plugins":{"workflow":{"rules":[{"case":[["host","!","in",["act-in.haha.com","pub-inner.haha.com"]],["uri","~*","/(.+)/inner/.*"]],"actions":[["return",{"code":403,"_vid":1}]]}],"_meta":{"disable":false}},"brotli":{"comp_level":6,"min_length":128,"vary":true,"_meta":{"disable":false},"lgblock":0,"http_version":1.1,"mode":0,"lgwin":19,"types":["application/atom+xml","application/javascript","application/json","application/rss+xml","application/x-font-ttf","application/x-javascript","application/xhtml+xml","application/xml","font/eot","font/opentype","font/otf","font/truetype","image/svg+xml","image/vnd.microsoft.icon","image/x-icon","text/css","text/javascript","text/plain","text/xml"]},"proxy-cache":{"hide_cache_headers":false,"cach
e_strategy":"disk","_meta":{"disable":true},"cache_zone":"disk_cache_one","cache_method":["GET","HEAD"],"cache_ttl":300,"cache_http_status":[200,301,404],"cache_control":false,"cache_key":["$host","$request_uri"]},"cors":{"max_age":3600,"allow_methods":"**","allow_origins_by_regex":["^http://localhost(:\\d+)?$","^http://127\\.0\\.0\\.1(:\\d+)?$","^http://10\\.255\\.\\d{1,3}\\.\\d{1,3}(:\\d+)?$","^https?://.*\\.haha\\.com(:\\d+)?$","^https?://.*\\.haha123\\.com(:\\d+)?$"],"allow_origins":"**","allow_credential":true,"allow_headers":"GL-ClientType,GL-Version,GL-CurTime,GL-DeviceId,GL-Token,GL-Uid","_meta":{"disable":false}},"gzip":{"types":["text/plain","text/css","image/jpeg","image/gif","image/png","application/xml","text/javascript","application/json","application/javascript","application/x-httpd-php","application/x-javascript"],"comp_level":3,"min_length":1024,"_meta":{"disable":false}},"prometheus":{"prefer_name":true,"_meta":{"disable":false}}},"update_time":1766717524},
context
: ngx.timer
```
## All the global plugin configurations in etcd are as follows
```
{"id":"1","create_time":1756174355,"update_time":1766717524,"plugins":{"brotli":{"_meta":{"disable":false},"comp_level":6,"min_length":128,"types":["application/atom+xml","application/javascript","application/json","application/rss+xml","application/x-font-ttf","application/x-javascript","application/xhtml+xml","application/xml","font/eot","font/opentype","font/otf","font/truetype","image/svg+xml","image/vnd.microsoft.icon","image/x-icon","text/css","text/javascript","text/plain","text/xml"],"vary":true},"cors":{"_meta":{"disable":false},"allow_credential":true,"allow_headers":"GL-ClientType,GL-Version,GL-CurTime,GL-DeviceId,GL-Token,GL-Uid","allow_methods":"**","allow_origins":"**","allow_origins_by_regex":["^http://localhost(:\\d+)?$","^http://127\\.0\\.0\\.1(:\\d+)?$","^http://10\\.255\\.\\d{1,3}\\.\\d{1,3}(:\\d+)?$","^https?://.*\\.haha\\.com(:\\d+)?$","^https?://.*\\.haha123\\.com(:\\d+)?$"],"max_age":3600},"gzip":{"_meta":{"disable":false},"comp_level":3,"min_length":1024,"t
ypes":["text/plain","text/css","image/jpeg","image/gif","image/png","application/xml","text/javascript","application/json","application/javascript","application/x-httpd-php","application/x-javascript"]},"prometheus":{"_meta":{"disable":false},"prefer_name":true},"proxy-cache":{"_meta":{"disable":true}},"workflow":{"_meta":{"disable":false},"rules":[{"actions":[["return",{"code":403}]],"case":[["host","!","in",["act-in.haha.com","pub-inner.haha.com"]],["uri","~*","/(.+)/inner/.*"]]}]}}}
```
--
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]