feature: support for proxy caching plugin based on disk.#1153
Conversation
|
Currently only supports the upstream dynamically specify the cache time. If the upstream does not specify it such as the header |
|
how to add test cases for this plugin? |
|
Hi @moonming Tests cases I think the t/servroot/conf/nginx.conf file should be modified. In recent days, i have been preparing to make a presentation. So I'm gonna add tests in this weekend. |
|
How about the new style? I think the new style is simpler. # current style
"proxy-cache": {
"cache_key": ["$uri"]
"cache_bypass": ["$arg_bypass"],
... ...
}# new style
"proxy-cache": {
"cache_key": ["uri"]
"cache_bypass": ["arg_bypass"],
... ...
} |
|
And I have other new questions:
|
Here can use variables or strings, so need an identifier to distinguish it. |
I'm also considering these things. For 2 if there is no better solution, cache purge script will be the final choice. |
Thanks. |
|
Do you have any suggestions for the test cases? Moreover, I think I should figure out the logic of the APISIX test cases. Thanks. |
|
LGTM. Need add this plugin to README.md. |
|
OK. I'll add it to README. Basically test cases are covered. |
|
@membphis ping |
|
@agile6v It seems that you have to rebase your branch, this branch has conflicted with master branch. |
Resolved. |
|
LGTM, we can merge it after run the test cases. |
|
merged, many thx @agile6v |
Summary
This is a prototype implementation and there is a lot of work to be done.
Hopefully it does not affect the review. Thanks.
The admin api looks like the following:
{ "plugins": { "proxy-cache": { "cache_zone": "disk_cache_one", "cache_key": "${uri}-cache-key", "cache_bypass": "${arg_bypass}", "cache_method": ["GET"], "cache_http_status": [200], "hide_cache_headers": true, "no_cache": "$arg_no_cache" } }, "upstream": { "nodes": { "127.0.0.1:1999": 1 }, "type": "roundrobin" }, "uri": "/hello" }Fix #1127