Data compression is an expensive, CPU-bound operation. So having the web server itself perform compression potentially multiple times for mostly static content seems rather counter-productive. If the content is pre-cached, a rewrite server module has to get involved. If the content is cached by the web server, that usually involves a memory/disk caching web server module (or even a completely different server like Varnish). In any case, multiple pieces of technology have to come together to support compressed content in the first place.
A better option, if it were available, would be to use a ‘srcset’ attribute on the ‘script’ element that declares a set of URLs and their ‘Content-Encoding’ equivalent for the same resource (gzip, deflate, etc). Then the compressed content could be pre-cached on disk on the server and statically delivered without requiring any custom server modules to be installed and configured. This would be analogous to img srcset but for data compression in the script element.