You can use some JS library for data compression, for example, this implementation of Huffman compression . However, the added compression slowness can very well compensate for the time you save in download speed. You should try this and make this decision for yourself, but overall it sounds like itβs not worth it. Moreover, this means loading more JS code, which creates a slower page loading time.
Unfortunately, browsers do not provide an API for any compression algorithms. Thus, you cannot use the fast inline implementation.
source share