logoalt Hacker News

CodesInChaosyesterday at 7:54 PM4 repliesview on HN

I'm confused by how this affects range requests. Without compression, those can be easily satisfied by reading the relevant part of the cached complete file. But how are they handled now? The article claims "range requests remain unchanged", but I don't see how that's possible if the cache no longer stores the uncompressed data.


Replies

gopalvyesterday at 9:09 PM

> I don't see how that's possible if the cache no longer stores the uncompressed data.

Zstd has a seekable format for frames, similar to pigz --independent works.

[1] - https://github.com/facebook/zstd/blob/dev/contrib/seekable_f...

pkulakyesterday at 7:58 PM

I assume the entire resource needs to be decompressed first, then indexed into, served, and discarded. Well, actually, you could just decompress up to the end of the range.

show 3 replies
nijaveyesterday at 9:23 PM

Idk but btrfs and zfs manage to pull it off

Seekable OCI (SOCI) uses an index so I imagine that's an option (real byte range a-b maps to compressed range x-y). Presumably you'd still need to read the header and some additional pieces

show 2 replies
butvacuumyesterday at 11:20 PM

they said they didn't change the behavior for range requests. So, it'll still be the basic no compression. (eg, server side decompression)