DisboxApp / web

Use Discord as a file storage service.
https://disboxapp.github.io/web/
GNU Affero General Public License v3.0
470 stars 87 forks source link

add gzip inflation and deflation to share URLs #60

Closed tris203 closed 9 months ago

tris203 commented 11 months ago

Remove un-needed params from download URLs and run through GZIP compression before base64ing them when generating a Share URL Do the reverse on the Files page when decoding them.

Proposal in #23

fixes #61 fixes #49 fixes #23

tris203 commented 11 months ago

Added additional code to address #61 Also fixes #49

DisboxApp commented 11 months ago

Awesome!

DisboxApp commented 11 months ago

Is GZIP the best compression we can use here? Maybe we can test lzma2 for even better results

tris203 commented 11 months ago

Is GZIP the best compression we can use here? Maybe we can test lzma2 for even better results

Brotli was the best in my tests but the package is huge Gzip seemed the best balance of speed, compression and package size and browser support

I looked at gzip, deflate and brotli

tris203 commented 11 months ago

I also renamed some variables to make the data flow clearer

DisboxApp commented 11 months ago

Will get to merging this soon.

DisboxApp commented 11 months ago

Actually, maybe we should add some compatibility feature to detect if inflation is used for past links to work?

tris203 commented 11 months ago

Actually, maybe we should add some compatibility feature to detect if inflation is used for past links to work?

I did think that old links would be broken, but I dont know how long people keep them around for...there was also fairly severe limitations in the URL length, so I dont think it got used that often...

DisboxApp commented 10 months ago

Actually, maybe we should add some compatibility feature to detect if inflation is used for past links to work?

I did think that old links would be broken, but I dont know how long people keep them around for...there was also fairly severe limitations in the URL length, so I dont think it got used that often...

Still, I think it's not that hard to add backwards compatibility here and it's a good practice in general.

tris203 commented 10 months ago

Added backwards compatability

DisboxApp commented 9 months ago

Should be the final review round :) Sorry it's taking so long, been busy lately.

DisboxApp commented 9 months ago

Looks good! Merging!