23557544 opened a new issue, #11748:
URL: https://github.com/apache/apisix/issues/11748

   ### Description
   
   ```
   {
     "id": "test-1107-weather-3",
     "uri": "/api/test/weather/cache2disk",
     "plugins": {
       "proxy-rewrite": {
           "uri": "/api/tianqi/tqyb.php"
       },
       "proxy-cache": {
           "cache_strategy": "disk",
           "cache_zone": "disk_cache_default",
           "cache_key":  ["$http_token", "$request_uri", "$request_body", 
"-cache-id"],
           "cache_ttl": 60,
           "cache_method": ["GET", "POST"],
           "cache_http_status": [200]
       }
     },
     "methods": ["GET"],
     "priority": 10,
     "upstream": {
       "type": "roundrobin",
       "nodes": {
         "cn.xxx.cn:443": 1
       },
       "scheme": "https"
     }
   }
   ```
   
   定义`cache_key`时,无法通过`$http_token`获取请求头中的token值,实际调用时token传入不同的值都会命中缓存。
   
   想问下`cache_key`如何获取自定义请求头?
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.11.0
   - Operating system (run `uname -a`): Linux rancher0 3.10.0-693.el7.x86_64
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): 
openresty/1.25.3.2
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`): 3.5.16
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
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]

Reply via email to