Giving the plugins a defined order seems to be of general use. Given such a capability you can then configure a ungzip plugin called first and a gzip plugin called last. Note however if no plugin in the middle modifies the body then neither ungzip nor gzip is necessary and the body can stay compressed. A plugin steering interface would be nice as well.
And a small warning using content-encoding for compression cause the body to be a different entity. Transfer-encoding would be better but is not supported by browsers. Be extra careful when you place it in the core. Regards, Roland -----Original Message----- From: Dzmitry Markovich [mailto:dmarkov...@linkedin.com.INVALID] Sent: Monday, March 23, 2015 11:08 PM To: dev@trafficserver.apache.org Cc: Brian Geffon; Cynthia Gu Subject: Adding Gzip/Gunzip feature in ATS core Hello ATS experts, Today it is very common that http data that goes to the wire is compressed. And we think it is a time to standardize this process in ATS core, since it is very common operation. Today multiple plugins running on the same tier (that operates with response body) do not have enough flexibility to handle gzip/gunzip - and most of the times simply every plugin do gzip/gunzip. This lead to the situation when we do gzip/gunzip multiple times while we process the http response. This leads to the bad CPU utilization and performance. Yes, there is gzip/gunzip logic in atscpp API - so plugins can simply use those. But today's ATS architecture does not allow us to fully control the order of hook callbacks for every plugin per request - it means there is no non-hacky way to prevent multiple gzip/gunzip calls while processing the request. And there is no way to do that with the assumption that plugins dnot know about each other. Here is our high level proposal, just to start the conversation going: - Have gzip/gunzip logic landed on ATS core, so engineers can ask ATS (vi config parameter) to take care about gzip/gunzip logic for them 1. Only ATS know when the body arrived to first plugin - so ATS at this point ungzip the body; 2. Only ATS knows when body is processed by all plugins and should go over the wire - so ATS at this point gzip the body if client supported it. Thanks, Dzmitry, Cynthia, Brian