-
-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Labels
Description
Most relevant area for this enhancement?
PDE
Feature to enhance
Enhancement details
Enhancement description
Add support for GZip compression in the Processing URI schema for sketches. Right now, encoded sketches are stored as raw base64, which produces very long strings.
Benefits
Allowing sketches to be compressed with GZip before base64-encoding would make the URIs shorter, allowing to fit larger sketches within URL length limitations.
Proposed Changes
- Add support for GZip-compressed sketches in the
pde://sketch/base64/
schema. - Use a prefix or content-type flag (e.g.,
pde://sketch/base64/gzip/<compressed_string>
) to distinguish between raw base64 and compressed+base64. - Update documentation to include examples for both formats.
Challenges
- Must ensure backward compatibility with existing base64 links.
- Requires adding GZip decompression logic in the schema handler.
- Slight increase in complexity when generating and parsing schema links.
- Needs clear documentation so users know when and how to use the compressed format.
Additional context
Example of the same sketch encoded both ways:
With GZip (476 characters):
eNpdUctugzAQvPsr5ugEFEjIo1KaQ9VrD1WrnqIcXDBghdjImEZtxL93DaSJKrFiH7Ozs+toOmWY4lVJPJfCOsCH3j4a2cCVEsKmfIK81alTRsMZFFJLKxyVUFNj2jfm1px6fCac8ASNM1ZmUBqCPmvF98wTR4wp7fYHyhYVjdjhgiQOMSdbrkIkZGvyk4cQG+9v0G0Z+zIqQyNdW5OYCwMa9SP5eumR63iypYw2786ao+Rj9GIMgbdAFOGt1TA6Jck688pq1o2cmRXnkfJTpMfCmlZnfB4PnLRffxeexDRpkEyFa/NfOa+McMiUOEknbYhhRX+KgXqoV6JxT56Dto49fW4sOGGh+gz9HvumWSV14UpKBMFAcKUo6I6EPYmaqxCk6Q7ex4vVqldODaqquMePsX/Is8pcGS1ClFIVpfPeTfTN+xN65wZWEEA33E/cq8NkpL0tFezwH+MhHet+AdGftnE=
Without GZip (820 characters):
LyoqCiAqIFBpZSBDaGFydCAgCiAqIAogKiBVc2VzIHRoZSBhcmMoKSBmdW5jdGlvbiB0byBnZW5lcmF0ZSBhIHBpZSBjaGFydCBmcm9tIHRoZSBkYXRhCiAqIHN0b3JlZCBpbiBhbiBhcnJheS4gCiAqLwoKaW50W10gYW5nbGVzID0geyAzMCwgMTAsIDQ1LCAzNSwgNjAsIDM4LCA3NSwgNjcgfTsKCnZvaWQgc2V0dXAoKSB7CiAgc2l6ZSg2NDAsIDM2MCk7CiAgbm9TdHJva2UoKTsKICBub0xvb3AoKTsgIC8vIFJ1biBvbmNlIGFuZCBzdG9wCn0KCnZvaWQgZHJhdygpIHsKICBiYWNrZ3JvdW5kKDEwMCk7CiAgcGllQ2hhcnQoMzAwLCBhbmdsZXMpOwp9Cgp2b2lkIHBpZUNoYXJ0KGZsb2F0IGRpYW1ldGVyLCBpbnRbXSBkYXRhKSB7CiAgZmxvYXQgbGFzdEFuZ2xlID0gMDsKICBmb3IgKGludCBpID0gMDsgaSA8IGRhdGEubGVuZ3RoOyBpKyspIHsKICAgIGZsb2F0IGdyYXkgPSBtYXAoaSwgMCwgZGF0YS5sZW5ndGgsIDAsIDI1NSk7CiAgICBmaWxsKGdyYXkpOwogICAgYXJjKHdpZHRoLzIsIGhlaWdodC8yLCBkaWFtZXRlciwgZGlhbWV0ZXIsIGxhc3RBbmdsZSwgbGFzdEFuZ2xlK3JhZGlhbnMoZGF0YVtpXSkpOwogICAgbGFzdEFuZ2xlICs9IHJhZGlhbnMoZGF0YVtpXSk7CiAgfQp9
The compressed version is significantly shorter.
Source: https://bugdays.com/gzip-base64
Would you like to help implement this enhancement?
No, I’m just suggesting the enhancement