-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
perf: allow skip body filter #8149
Conversation
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be a core API to get the version of APISIX runtime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you thing? @spacewander
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean move pcall(require, "resty.apisix.response")
on apisix core level?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
apisix/plugins/ai.lua
Outdated
end | ||
|
||
if is_apisix_or then | ||
local ok, err = response.skip_header_filter_by_lua() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only the current request skips the ***_filter, all right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No skip_header_filter_by_lua?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cancel skip_header_filter_by_lua, because we add APISIX/2.99
in 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