The Quiet Cost of Three Different Compression Scripts
There is a particular kind of mess that doesn't show up in any architecture diagram. It lives in the corners of a codebase: a compression helper written by one engineer, a second one written by the person who didn't trust the first, and a third that quietly calls a web endpoint because that was faster on a Tuesday. Nobody set out to create it. It accumulated the way sediment does.
I was reminded of this when a friend described their nightly document sync failing for the fourth time that week. Scanned contracts in the tens of megabytes, spreadsheets with high-resolution images nested inside, a retrieval service throttling the upload. Three engineers, three scripts, and not one of them willing to vouch for another's output. The failure wasn't technical sophistication. It was the absence of a single, agreed-upon way to do one unglamorous thing.
What we were actually trying to solve
It took a while to name the real problem. We weren't trying to make files smaller for their own sake. We were trying to keep one step in a pipeline from becoming a bottleneck that stalled everything downstream. Once we said that out loud, the three scripts stopped looking like three solutions and started looking like three duplicates of the same unfinished job.
That reframing is the most useful thing I can offer here. Teams rarely argue about compression because they disagree on bytes. They argue because nobody has written down what the compression is for. Is it for archiving, where fidelity and an audit trail matter? For email, where size is the whole point? For feeding a retrieval system, where a little lost visual detail is a fair trade for speed? Each answer implies a different setting, and "compress it" hides all of them.
The questions that changed our choices
The first question was where the data goes. IBM's research on breach costs found that among affected organizations, one in five traced the cause to employees using AI tools on their own, with those companies paying roughly $670,000 more than peers on average — and 63% had no governance policy at all. Shadow AI sounds abstract until you realize it often begins with someone uploading a contract to a convenient online endpoint because it was quicker. We settled on a simple rule: the capability can come to us, but the files don't leave us. That ruled out a whole class of convenient options and made the remaining decision much easier.
The second was about structure. An Office document looks like one file but behaves like a container, holding images and embedded objects inside. We learned this the annoying way — compressing the outer layer barely helped because the pictures within were untouched. Once those embedded images were included, files stopped being slim outside and bloated within. On a single file that's unremarkable. Across a few hundred in a nightly batch, the saved transfer and queue time became the difference between a job that finished and one that timed out.
The third was about failure. In any real bulk workload, some files will misbehave. What matters is whether the system tells you, isolates the bad one, and lets you retry just that piece. An honest "I left this one unchanged" is worth more than a clever compression ratio that silently corrupts a seal on a contract.
A small table I keep coming back to
When I evaluate any tool in this category now, I use the same handful of dimensions. It keeps me honest.
| Dimension | What I actually ask |
|---|---|
| Data boundary | Where does the file live throughout the operation? |
| Format coverage | Does it handle nested images, not just the outer container? |
| Batch behavior | Is one failure isolated, traceable, retryable? |
| Failure semantics | Does it say so when a file won't compress? |
| Fidelity | Can settings match the purpose — archive versus retrieval? |
| Compliance | Can it run in my own environment, with an audit trail? |
Asana's Anatomy of Work offers a quiet footnote to all this: people switch between more than thirty apps a day on average, and a single interruption takes over twenty minutes to recover from. Tools multiply faster than attention does. Folding an unglamorous step into one stable, callable place isn't exciting work. It's the kind that makes the 2 a.m. alerts finally stop — which, in the end, was the whole point. If your team has a similar setup, the product overview is a reasonable starting point, and the developer pages lay out the different shapes the capability can take.
Try it now
FAQ
Q: Why did three similar scripts cause so much trouble?
A: Not because any one was badly written, but because nobody had agreed what the step was for. Different purposes imply different settings, and without that written down, three scripts become three unverifiable versions of the same job.
Q: Does a good compression tool always reduce file size?
A: No. Some files are already compact or grow when re-encoded. The honest behavior is to report that and keep the original, rather than forcing a smaller number at the cost of fidelity.
Q: What is the cheapest way to find out if a tool fits our documents?
A: Build a small sample from your own real files — the awkward scan, the chart-heavy spreadsheet, the faint-seal contract — and measure clarity, size, and time on those. It tells you more than any generic benchmark.
Q: When does on-premise processing actually matter?
A: When the documents carry sensitive information or fall under retention rules. If a file leaving your network creates a compliance question, the processing capability needs to come to you instead.