joshdcu opened a new issue, #12707: URL: https://github.com/apache/apisix/issues/12707
### Current Behavior The `ETag` and `Last-Modified` headers are cleared when the response is compressed by the Brotli plugin: https://github.com/apache/apisix/blob/0c794a04998729ea732a6054ad3a973cb87eabc7/apisix/plugins/brotli.lua#L225-L226 https://github.com/apache/apisix/blob/0c794a04998729ea732a6054ad3a973cb87eabc7/apisix/core/response.lua#L158-L166 ### Expected Behavior The `ETag` and `Last-Modified` headers from the upstream server should be preserved even though the response is Brotli-compressed. Clearing these headers is not required because if the source content has not changed, then the compressed content would not change either and the browser can avoid requesting the unchanged content from the server again. The [APISIX `gzip` plugin](https://github.com/apache/apisix/blob/master/apisix/plugins/gzip.lua) appears _not_ to clear these headers. This also indicates that clearing these headers is not required. ### Error Logs _No response_ ### Steps to Reproduce 1. Build an APISIX image with the Brotli shared libraries as mentioned [in the documentation](https://apisix.apache.org/docs/apisix/plugins/brotli/#prerequisites). 2. Prepare an upstream server that returns a response with the `ETag` and `Last-Modified` headers. 3. Create an APISIX route to the upstream server that enables the Brotli plugin. 4. Make a request to the upstream server via APISIX with the `Accept-Encoding` header set to `br` and observe that the `ETag` and `Last-Modified` headers are removed. ### Environment - APISIX version (run `apisix version`): `3.9.1` - Operating system (run `uname -a`): Linux - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): `nginx version: openresty/1.25.3.1` - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`): Not relevant - APISIX Dashboard version, if relevant: Not relevant - Plugin runner version, for issues related to plugin runners: Not relevant - LuaRocks version, for installation issues (run `luarocks --version`): Not relevant -- 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]
