-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
feat(proxy): Allow to remove the proxy cache headers #10445
Conversation
631d6a3
to
f7fd4ad
Compare
@hbagdi Please give this your final review. |
f7fd4ad
to
17eece8
Compare
Is this potentially a breaking change in terms of the behavior of the proxy? |
@hbagdi I have described the impact.
Nothing has changed on the caching part, just the headers added in the response. If you think it is a breaking change I can add a configuration param in addition of debug mode to control if headers are added |
The reason why we've not just merged this change is that even though your opinion matches ours, we don't know how many customers rely on the incorrect behavior of Kong. We're still in the decision process.
Adding a specific configuration parameter to disable incorrect behavior of previous versions of Kong should be the last resort, but we may want to go that route and make the correct change, like you proposed, in the next major release. Please bear with us for a couple of more days. |
@hanshuebner How is this not a breaking change? |
@hbagdi All the arguments have been made. From your question, I take it that you don't agree that we can merge this. Please let us know how to proceed. |
@hbagdi The gist of the problem here is the interpretation of what the headers
|
Not sure that not being able to not sent the header was acceptable. |
The API was not clear and the RFCs do not make it obvious that these headers are for debugging. I recommend adding a flag as @utix suggests to avoid this breaking change, especially since the plugin has been around for a long time. |
Another alternate solution is to go for an "allowlist" based approach which gives user the control over which headers should be emitted by Kong when this plugin is run. That essentially gives user a toggle over each header and allows the user to emit the cache status header (generally considered useful) and hide the cache key header (generally hidden) and other combinations. |
I was planning to add a flag for each header, to put it on the answer. set to true by default to keep the behavior |
Is a single configuration field that is an array of string better? Or worse? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I have added a response_headers field into the configuration with 3 fields:
Allowing to set or unset the presence of the header into the response. As discussed, to keep previous behavior, all fields are present by default. |
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.
Almost there! Now there is only the missing CHANGELOG entry and the docs update to be done. Also, the pull request title and description need some work to reflect what the change is about. @utix can you do that?
This needs a compat change as well i.e. addition to removed_fields.lua. |
Closing because of lack of activity. We would like to accept this contribution if anyone wishes to pick this back up. |
Not sure what is missing, just rewords the Merge request?
…On Mon, Jun 26, 2023, 20:00 Harry ***@***.***> wrote:
Closed #10445 <#10445>.
—
Reply to this email directly, view it on GitHub
<#10445 (comment)>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB345OTE5PTWI3TH64KCCTXNHE2FANCNFSM6AAAAAAVSQJISI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
That and #10445 (comment). Please re-open if you want to take this to the finish line. |
I have reword the PR, changelog commit is done on my fork, I don't have permission to reopen the PR. |
@utix The removed_fields.lua update is required to make older dataplanes compatible with newer control planes. When preparing a configuration to be sent to a data plane, the control plane removes configuration fields that are present in the current configuration but that were not supported in the version of the target data plane. The removed_fields.lua file lists, for each version, what fields were added. Please include the new configuration fields in the section for 3.3->3.4. |
The following headers: * X-Cache-Status * X-Cache-Key * Age are now set only if the header kong-debug is set to 1 And they are removed from the cache value
… the response Keep previous behavior with default configuration. Debug header allows to get all info, each header has a configuration field to be or not into the response
d41eb8e
to
2e15a2b
Compare
@hanshuebner is it good now ? If something else is needed can you highlight it ? |
@utix Finally merged, thank you for the contribution and your efforts getting it over the line! |
Thanks for your support to make it happen |
Will double-check when CE2EE merge. |
…ock dictionary in RLA (#10445) Added a new configuration field `lock_dictionary_name` to support specifying an independent shared memory for storing locks. https://konghq.atlassian.net/browse/FTI-6266
Update of #7829
Summary
Adding Miss/Hit, Age and cache key to answer shouldn't be the default behavior.
Add option to remove the proxy cache headers from the response.
If the kong debug is set keep the headers
Full changelog
The following headers:
X-Cache-Status
X-Cache-Key
Age
can be now be removed from the answer via the
response_headers
option,for example to remove all:
Default behavior to have all the header set is kept for retro compatibility reason.
Refactor test to remove duplicated lines and use get, post and delete helpers instead of send