# Reducing Bucket Costs: The Content-Type Mistake That Hides in plain sight

> Skipping Content-Type on S3 uploads defaults everything to application/octet-stream. Your app works fine—until a CDN, caching layer, or metadata cleanup turns a one-line fix into a real AWS bill.
Published: 2026-08-13
Tags: aws, s3, object-storage, cdn, devops

Source: https://hugo-portfolio-teal.vercel.app/blogs/reducing-bucket-costs/


In both of my first two companies, I observed a common mistake.

When uploading to S3 buckets, no `Content-Type` was being set on the object.

And what happens when you don't pass it?

The bucket assigns `application/octet-stream` as the content type.

And everything continues to work perfectly.

Yaay 🎉

Your object is 2 MB.

You download it from the browser.

It downloads.

The UI works.

All the test cases pass.

Everything is beautiful.

**Yaay.**

No.

**Naay.**

The problem is that the journey from an S3 object to your browser is not simply:

`S3 → Browser`

There is a whole pipeline sitting in between.

The object gets fetched, transferred, potentially cached, processed by CDNs, passed through networking layers, and eventually interpreted by the browser.

And when all these systems see:

`Content-Type: application/octet-stream`

they basically say:

> "Okay... it's some binary data. 🤷"

They don't really know what they're dealing with.

But when you tell them:

`application/json`

or

`image/jpeg`

or

`text/css`

or any other appropriate content type, you're giving them useful information.

Now the systems in the pipeline know what they're dealing with.

And that allows them to use the optimized paths available for that particular type of content.

You get better handling.

You get better performance.

And the best part?

**You didn't pay anything extra for this optimization.**

Just a tiny metadata field during upload.

Beautiful.

Until one day...

You decide to put a CDN in front of your bucket.

And suddenly you look at your S3 bucket and realize:

> "Wait... why is everything `application/octet-stream`?"

😭

And now begins the cleanup operation.

You need to update the metadata of all those existing objects.

Which means touching a potentially huge number of objects.

Which means more requests.

More data transfer.

More processing.

And suddenly that tiny mistake you made months ago has become a very real line item on this month's AWS bill.

**AWS billing has entered the chat.**

😭

This is one of those engineering mistakes that is particularly dangerous because **nothing breaks**.

Your application works.

Your tests pass.

Your users don't complain.

And that's exactly why it survives for months.

Until one day you introduce something new—usually a CDN, some caching layer, or a different way of serving the objects—and suddenly you discover the little decision you made during an upload has been following you around this entire time.

So, whenever you're uploading objects to S3—or any object storage for that matter—be explicit about the `Content-Type`.

It's a tiny thing.

It takes almost no effort.

And it can save you from a surprisingly expensive cleanup later.

Don't let `application/octet-stream` become your technical debt's hiding place.

Stay happy and stay blessed.

I know you are awesome ❤️

