News for hackers. Stuff that matters.
Re:Why my favourite API is a zipfile on the European Central... by theamk on Friday September 15, 2023 @06:43PM (#37529987)
HTTP compression is optional, so they either have to compress on the fly (wasting cpu) or provide multiple versions (complicating setup and deployment) or make some HTTP clients not work.

simgle zip file is really the easiest solution for cases when the file must absolutely be compressed

Re:Why my favourite API is a zipfile on the European Central... by sethhochberg on Friday September 15, 2023 @07:16PM (#37530221)
Many webservers allow you to serve a compressed file (stored on disk) and _decompress_ when a client specifically can't support the compressed encoding. Since most clients should support compression, this means you only use the CPU for the rarer case where the uncompressed data is required.

Eg, http://nginx.org/en/docs/http/ngx_http_gunzip_module.html

Re:Why my favourite API is a zipfile on the European Central... by nikau on Friday September 15, 2023 @08:39PM (#37530822)
Or you can just zip it explicitly and remove complexity and future issues it they have to move to another web server platform.
Re:Why my favourite API is a zipfile on the European Central... by MengerSponge on Friday September 15, 2023 @08:49PM (#37530883)
But what if an analyst needs to access this data and run their regressions on a potato? Surely that use case is worth adding a few libraries to handle.
Re:Why my favourite API is a zipfile on the European Central... by innocenat on Friday September 15, 2023 @09:18PM (#37531043)
I would think running regression should be more demanding on the potato then decompressing ZIP file.
Re:Why my favourite API is a zipfile on the European Central... by CJefferson on Friday September 15, 2023 @10:35PM (#37531489)
What machine could anyone be running an analysis on where unzip is a limiting factor?
Re:Why my favourite API is a zipfile on the European Central... by londonReed on Friday September 15, 2023 @11:45PM (#37531872)
Whoosh
Re:Why my favourite API is a zipfile on the European Central... by adbachman on Saturday September 16, 2023 @08:19AM (#37534177)
you heard them, a literal potato from the ground.

even a big old russet only has, what, like 32 bites?

Re:Why my favourite API is a zipfile on the European Central... by pantalaimon on Saturday September 16, 2023 @12:17PM (#37536114)
I mean there are some potatoes that take more then four bytes to eat, but they are rare.

For some, if you slice them, you might even end up with only 16 bits.

Re:Why my favourite API is a zipfile on the European Central... by nikau on Saturday September 16, 2023 @04:59AM (#37533162)
hmm good point, can you draft up an architecture plan using multiple microservices and redundancy via a kubernetes cluster and have it on my desk by Monday please.
Re:Why my favourite API is a zipfile on the European Central... by avandelay1 on Friday September 15, 2023 @08:08PM (#37530588)
Nginx or Apache would both cache these versions transparently. I think they just wanted to distribute as a zip
Re:Why my favourite API is a zipfile on the European Central... by anakaine on Friday September 15, 2023 @08:35PM (#37530792)
The business logic here is >15 years old. Http compression was only in early stages then, and you can guarantee that many client side scripts and libraries would jot have supported it. Zip was well known. Compress and place.

If I'm not missing the point here, this was, and still is, about offering the simplest, most reliable solution over a long period. This is a near perfect example of how to do exactly that. No changing formats, no moving requirements, no big swings in frameworks, apis, or even standards. And most importantly, no breaking your customers business workflows.

Re:Why my favourite API is a zipfile on the European Central... by skylanh on Friday September 15, 2023 @09:33PM (#37531135)
No edge case dependencies on the WWW server's configuration, and no sudden "why did we just saturate our external connection?"

No emergency change requests from the outage team that has to be impacted by other areas and fit into the infrastructure's teams maintenance windows and their capacity to address that.

No rebalancing of workloads because Jane had to implement (or schedule the task and monitor it) that change, Joe had to check and verify that the external availability tests passed, and Annick had to sign off on the change complete, and now everyone isn't available for another OT window for the week.

Or something.

Re:Why my favourite API is a zipfile on the European Central... by chrisweekly on Saturday September 16, 2023 @12:24PM (#37536194)
> "The business logic here is >15 years old. Http compression was only in early stages then"

At least one of us is confused about history here; are you really saying that circa 2008, HTTP compression would have been considered immature or unstable?