perf: allow skip body filter#8149
Conversation
| local ngx = ngx | ||
| local is_http = ngx.config.subsystem == "http" | ||
| local enable_keepalive = balancer.enable_keepalive and is_http | ||
| local is_apisix_or, response = pcall(require, "resty.apisix.response") |
There was a problem hiding this comment.
this should be a core API to get the version of APISIX runtime
There was a problem hiding this comment.
You mean move pcall(require, "resty.apisix.response") on apisix core level?
There was a problem hiding this comment.
It is possible but not valuable to do this, as we don't want to support multiple versions of APISIX-Base, only support the latest APISIX-Base. Maybe a simple API to detect if apisix-base / openresty is used is enough.
| end | ||
|
|
||
| if is_apisix_or then | ||
| local ok, err = response.skip_header_filter_by_lua() |
There was a problem hiding this comment.
Only the current request skips the ***_filter, all right?
There was a problem hiding this comment.
no, it effects global
| end | ||
|
|
||
| if is_apisix_or then | ||
| local ok, err = response.skip_body_filter_by_lua() |
There was a problem hiding this comment.
No skip_header_filter_by_lua?
There was a problem hiding this comment.
cancel skip_header_filter_by_lua, because we add APISIX/2.99in the header_filter phase, and enable_server_tokens = false cannot be used as a flag to skip header_filter_by_lua because it only removes the version in server token, not delete the server token unless we add another switch for removing the server token completely.
7d74b45
Description
Fixes # (issue)
Checklist