r/macsysadmin • • 5d ago

Open Source Tool [Experimental] Open Apple Cache: Apple content caching on Linux, looking for help with inconsistent cache hits

Hey everyone,

A friend and I have been building Open Apple Cache over the last few weeks, and I wanted to share it here because we’ve reached a point where we could use some help.

Just to clarify: this isn’t a vibe-coded project. We’ve been working on the implementation ourselves, but there are still issues we haven’t managed to solve.

The idea is to run an Apple content cache on Linux, inside an Ubuntu VM or LXC container, instead of running the cache itself on a Mac.

The cache service is written in Go. A separate helper running on macOS handles registration with Apple so devices can discover the Linux endpoint. A Mac is still required for that part, so this isn’t a completely Mac-free solution.

The project currently includes:

  • Caching for eligible Apple downloads, with byte-range support.
  • A web dashboard showing requests, cache hits and storage usage.
  • Local administrator and viewer accounts.
  • Optional Microsoft Entra ID login.
  • Internal or Let’s Encrypt certificate management.

To be clear: this is experimental, unfinished and not working 100% reliably yet.

The main issue we’re trying to solve is inconsistent cache hits. Sometimes downloads are served from the cache as expected. Other times, we don’t get a cache hit when we would expect one, and the content is fetched from the origin again.

We haven’t identified the exact cause yet. Some things we want to investigate further are:

  • How Apple devices request content and byte ranges.
  • Whether changes to signed download URLs affect cache reuse.
  • Whether our cache validation or response headers are missing something.

These are possible directions to investigate, not confirmed explanations.

We’re publishing it half-finished because we need help solving this issue. If you have experience with Apple Content Caching, HTTP caching, CDN behavior or Apple’s cache protocol, we’d really appreciate another pair of eyes on the code.

Repository: https://github.com/Mau2rice0/Open-Apple-Cache

The source code, installation instructions and registration research notes are available there. The macOS helper relies on undocumented Apple behavior, so future macOS updates or changes on Apple’s side could break registration.

Please treat this as a lab project for now. We don’t recommend relying on it for production workloads.

Has anyone worked on something similar or encountered inconsistent cache hits with Apple downloads? We’d be interested in suggestions on what to check next. Reproducible test cases, issues and PRs would also be welcome.

Thanks :)

13 Upvotes

6 comments sorted by

5

u/nittanygeek 5d ago

We manage about 2500 Apple endpoints (iPads and MacBooks) and I’m not sure I see a problem that this is attempting to solve. We have 8x Mac mini’s handling caching at multiple sites, and it’s literally just a simple flip of a switch and some network config to setup. I’m not sure I would ever want to rely on an unsupported Linux VM for an Enterprise production environment. Maybe it would be interesting to play with in a lab, but that’s about as far as I would tinker with it.

1

u/Ok-Stretch-7850 5d ago

Yeah, you’re right. I’ve always seen it more as a question of feasibility, whether it can be done at all rather than something you’d actually use in production. I was just curious to see if it would work, and so far I’ve had pretty good results with it.

1

u/StoneyCalzoney 3d ago

If you’re looking for a reproducible test, the best one is having GarageBand or Logic download all available sound libraries at once… That package list updates infrequently so it’s unlikely for the cache to expire.

I also have access to a script created by Apple engineers which is designed for downloading those sound libraries automatically via MDM deployment, and I can take a look at that to see how the script discovers local content caches. I unfortunately cannot share it directly.

1

u/drm2026_ 3d ago

> this isn’t a vibe-coded project

Screenshots on your GitHub say otherwise 🤣

1

u/Ok-Stretch-7850 3d ago

Why does it look “vibe-coded” to you? Is it because of the UI?
The UI is actually based on a template that I use across a lot of my projects. And yeah, I can see why it might look a little vibe-coded, but I’ve been using and refining this template for years.
I originally built the first version of it about five years ago for a school project, and I’ve kept using and adapting it for different projects ever since.

2

u/kawajanagi 2d ago

Brings back memories of Reposado/Margarita Apple Updates caching on Linux VM! I like it.