I'm doing the following:
- Using ShallowEtagHeaderFilter
- Manually setting ETag header (because the response body contains random elements which should not be included in ETag so it cannot be generated by ShallowEtagHeaderFilter)
- Having a converter which extends AbstractHttpMessageConverter
But ShallowEtagHeaderFilter returns the raw output stream if ETag header is already set, and AbstractHttpMessageConverter flushes the output stream, which commits the response so it cannot be updated to return 304+no body.