ilesinge / prodo

simple web publishing
http://ilesinge.github.io/prodo/
13 stars 3 forks source link

Compress the URL #8

Open ilesinge opened 9 years ago

ilesinge commented 9 years ago

The data present in the redirection link is converted from the original document to Base64, thus it is inherently longer.

Ideally, the redirect link should be shorter than the document itself.

A compression algorithm such as gzip or LZW (or a home-made solution) could be used.

Example JS compression code/librairies: https://github.com/beatgammit/gzip-js https://github.com/pieroxy/lz-string/ https://github.com/floydpink/lzwCompress.js https://gist.github.com/revolunet/843889

Ideally the chosen algorithm's implementation would be, itself, small.

ping @TBaudon

ilesinge commented 9 years ago

Also: https://github.com/nmrugg/LZMA-JS But https://github.com/pieroxy/lz-string/ seems more interesting (for its size + the compressToEncodedURIComponent / decompressFromEncodedURIComponent functions).