question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add "header" for compressed items

See original GitHub issue

Since your main goal was to use it with localStorage (similar to mine). It would be interesting to prepend on the compressed string a kind of header. Something along the lines of data URIs in CSS but less verbose. Example:

"lz;<encoded data>"

In that way it makes easier to identify if the data being used is compressed or not.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
JobLeonardcommented, Oct 19, 2018

just add a version flag and check against that

As Rycochet mentioned: that’s not so simple because the current format is pure a raw compression string without any metadata. However, I just wrote a proposal for how one might want to approach a newer format in a backwards-compatible way. Have a look.

0reactions
heflercommented, Oct 19, 2018

@JobLeonard That’s more like it! 😃 👏

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding header to zlib compressed file - Stack Overflow
It seems to work when I compress a file, but I am trying to prepend the zlib compressed file with custom header. Both...
Read more >
Serving compressed files - Amazon CloudFront
Viewers indicate their support for compressed objects with the Accept-Encoding HTTP header. CloudFront can compress objects using the Gzip and Brotli ...
Read more >
k6 should add HTTP `Accept-Encoding` request header by ...
It should be easy for a k6 user to specify globally that they want compression enabled on all HTTP requests. The current inability...
Read more >
Are servers allowed to add a Content-Encoding header based ...
Suppose we have a compressed archive on disk, e.g. file.tar.gz , which should be served as-is. The file is served with Content-Type: application ......
Read more >
Specifying HTTP headers - IBM
To compress the data in a response, set the Accept-Encoding header. Table 3. Compression header values. Header name, Value, Description. Accept ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found