Stop the Twitter for Mac Image Cache Folder from Growing Huge
The Twitter for Mac client has a peculiar feature (bug?) which causes the app image cache to grow endlessly and without limitation. That means the Twitter image cache folder can easily become several gigabytes in size unbeknownst to the end user, and those cache files are also stored in virtual memory, which can cause unnecessary RAM usage and swapping on a Mac. Thus, if you use the Twitter app in OS X, you may want to manually intervene from time to time to delete this image cache, otherwise you’ll find your disk space slowly disappearing as the cached image files from your twitter stream get saved to disk, never clearing itself out. You also may get fed up with that manual cache deletion process and decide to prevent the app from saving any image cache, so we’ll show you how to do that too.
If you don’t use the Twitter app for Mac OS X this won’t apply to you, none of the other Mac Twitter clients have this issue. This is almost certainly a bug with the Twitter app, but it’s unclear if/when they will get around to fixing it with an app update.
The Location of Twitter Image Cache
The cache directory of profile images and embedded pictures from tweets is located at the following location in OS X (note the user library folder, not system library):
The easiest way to get there is with Go To Folder, accessible from the Finder “Go” menu and choosing “Go To Folder” (or hit the Command+Shift+G shortcut). Trashing the contents of that folder (not the folder itself) is sufficient to rid the problem, be sure you quit the Twitter app afterwards to unload all the cache from memory too.
Assuming you have the Finder Status bar enabled, you’ll immediately see how many files are sitting in this folder. If you’re a regular Twitter user you’ll probably find it to be well into the thousands, which is likely to translate into a notable amount of disk space.
If you’re an active Twitter user who uses the livestream update feature and you’re going to be trashing this folder often, you may want to make an alias of it somewhere so that you can manually dump the contents, or proceed with the next step and just prevent the app from keeping all that junk around to begin with.
Preventing Twitter App from Saving Image Cache Files
Tired of manually deleting the cache files? Me too. You can prevent the Twitter app from being able to save all that cache by locking down the folder. This could theoretically result in increased bandwidth usage as each file has to be downloaded from servers again, so you would not want to do this on an internet connection with a strict data quota, like an iPhone hotspot plan. If you’re sure you want to lock down that folder and stop the image cache once and for all, here’s what to do:
- Hit Command+Shift+G from a Finder window and go to the following path:
- Select the “com.atebits.tweetie.profile-images” folder and hit Command+i to ‘Get Info’ about that directory
- Check the box for “Locked” so that it’s enabled, then close out of the Get Info window
- Quit Twitter.app, let it sit closed for a minute or so, and relaunch it (this is to dump the cache from memory)
You can watch the folder now and even with a very busy Twitter stream, no cache files will be saved into that cache directory.
Users who are comfortable with the command like could go with a more technical approach by implementing a symbolic link from the /com.atebits.tweetie.profile-images/ folder directly to the user Trash (at ~/.Trash/) or even to /dev/null/, but simply locking the folder form the Finder is sufficient to prevent the images being saved.
As far as I can tell, nothing in that “com.atebits.tweetie.profile-images” folder is essential to keep and deleting the contents will have no impact on Twitter or anything else. It’s possible that keeping a ridiculously large image cache could allow the app to perform somewhat faster when scrolling through ancient tweets, but to me that does not warrant the potentially large size of the directory.
The first time I came across the folder was with the help of OmniDiskSweeper, a great tool that scans a Mac hard drive for large files and folders, and it was found to be 8GB. On a MacBook Air with only 128GB of total disk space, that’s a considerable amount of wasted space for something that serves little purpose. I then started to empty the cache out manually once every week or so, and each time it’s somewhere between 1GB and 4GB, depending on the tweet activity for the prior week and how many pictures people embed in their tweets. Eventually I decided to lock down the directory, and so far haven’t had any problems with the app as a result.