Methods for dealing with macOS Wallpaper Cache

Hello,

Back in January 2024, I filed a bug report regarding a cache being kept by the macOS Wallpaper Agent. This cache contains every image ever set as a users wallpaper, and at the time the issue was reported, it never cleared, leaving hundreds of gigabytes wasted on users disks in some cases.

FB13536275

This issue was ultimately fixed in macOS 15.1 beta 6, and remained fixed for the duration of macOS 15. The fix was excellent - the cache was reduced to storing just 2-3 days worth of images.

Sadly, we've discovered that this issue is back in macOS Tahoe. The cache has moved locations, and once again is not clearing. We have filed this bug again, less than a year after it was first fixed:

FB20636593

We develop an app called 24 Hour Wallpaper that keeps the wallpaper in sync with the time of day. This necessitates that the app regularly changes the wallpaper, which sadly now results in an infinitely growing and useless cache of BMP files generated by the system.

As we waited 10 months for this to get fixed the first time, we expect to wait at least that long to get it fixed again, and have no confidence that it will stay fixed because the last fix lasted less than a year. This leaves us in a bad position, as people can't use our app without the cache growing arbitrarily and ultimately completely filling their disk.

We've already had customers call Apple to complain about this, and the good news is that the support agents understand that this is a problem with macOS, not with our app.

What we've decided to do is add a feature to the app that monitors the size of this cache and periodically deletes it. We're required to get the users permission the first time to do this, but after that the permission is cached, so the app can keep the cache folder clean regardless of if macOS is doing it's job or not.

We haven't seen any side effects or problems as a result of doing this. We've seen other apps like CleanMyMac do this without any problems. We're wondering if there is anything we should be aware of regarding this caches behavior before releasing this flushing feature.

Thanks for your time,

-josh

Answered by DTS Engineer in 862975022
FB20636593

Just FYI, that’s definitely made it to the right people.

We're wondering if there is anything we should be aware of

Unfortunately there’s no way for us to answer that. Modifying files ‘behind the back’ of the OS is unsupported. Even if it works perfectly today, there’s no guarantee that it won’t have seriously negative consequences in the future.

I understand why you’re planning to do this, but it’s a risky choice.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

FB20636593

Just FYI, that’s definitely made it to the right people.

We're wondering if there is anything we should be aware of

Unfortunately there’s no way for us to answer that. Modifying files ‘behind the back’ of the OS is unsupported. Even if it works perfectly today, there’s no guarantee that it won’t have seriously negative consequences in the future.

I understand why you’re planning to do this, but it’s a risky choice.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thank you for ensuring that this issue is properly routed. That means a lot to us. I understand the risk involved in our approach, but that has to be balanced against the risk of not doing this. For us, our app resulting in a users disk continually filling over time is a far worse problem than any evident side effect of clearing the cache. As far as we know, this, like the vast majority of bugs we submit around wallpapers and screen savers, with either never get fixed, or only partially fixed.

You can get the beta with the new cache cleaning feature here:

https://testflight.apple.com/join/Bnbm6uJY

Thank you.

Methods for dealing with macOS Wallpaper Cache
 
 
Q