Squid is a HTTP(S) caching proxy to reduce bandwidth and improves response times.
Data compression proxy is a http proxy by google aimming to reduce cellular data usage by gzip and webp (Yes, it will compress jpg, png and gif to webp).
The data compression proxy requires an extra http header "Chrome-Proxy", the details of this field can be found here
To combine them together, I've patched the Squid souce code to add this header for each out going requests.
To deploy this proxy to all clients on my home work, I am using WPAD For the WPAD, in my case, I am hosting this wpad.dat on openwrt router and I've configured both DHCP and DNS to cover most devices in my home network.
Here is a comparsion of data usage for opening a webpage with lots of pictures.
Without "Squid + data compression proxy"
With "Squid + data compression proxy"
That's a 2.7MB saving for a single page!
- Some websites doesn't work well with the compression proxy, maybe we could teach squid to connect the target site directly
- Stats for compression and data saving
- Better whitelist for "DIRECT" sites in wpad.dat
FWIW, the auth header functions from the JS plugin appear to be here:
https://github.com/cnbeining/datacompressionproxy/blob/master/background.js