You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Where does Calendar keep its caches?

Can someone tell me where Calendar keeps all its caches and/or how to remove them?


I have been trying to clean out unwanted calendars but they keep coming back.


The process I am going through is this:

1. delete the unwanted calendars in the Calendar app

2. delete all the subfolders of ~/Library/Calendars which are contain the deleted calendars just leaving the ones I want

3. stop CalendarAgent

4. delete the 3 files in ~/Library/Calendars "Calendar Cache", "Calendar Cache-shm" and "Calendar Cache-wal"

5. empty Trash

6. log out


But when I log back in and open Calendar, after a few minutes all the unwanted calendars are back. I could understand if it were recreating default calendars but it seems to be every calendar that has ever existed for this user.


I've tried removing the folders and cache files while logged in as a different user (as CalendarAgent restarts itself after being stopped), I've also tried rebooting rather than just logging out but nothing seems to work. Calendar is retrieving the information from somewhere, and putting the calendars (complete with the events they contain) back into the ~/Library/Calendars folder and the Calendar interface.

iMac 27″, macOS 10.14

Posted on Apr 30, 2021 3:08 AM

Reply
Question marked as Top-ranking reply

Posted on May 11, 2021 6:19 PM

I finally found the cache.


I did spend time searching the Containers directory but many of the likely named folders had no cache contents and deleting the contents of those I found did not solve the problem.

~/Library/Containers/com.apple.CalendarAgent/data/Library/Caches/com.apple.CalendarAgent/

and

~/Library/Containers/com.apple.iCal/data/Library/Caches/com.apple.iCal/

as well as the 3 files ~/Library/Calendars/Calendar Cache*

were the only ones I found.


~/Library/Containers/com.apple.CalendarFileHandler/Data/Library/Caches

~/Library/Containers/com.apple.CalendarNotification.CalNCService/Data/Library/Caches

~/Library/Containers/com.apple.iCal.CalendarNC/Data/Library/Caches

and several others were empty anyway.


I decided to search ~/ using grep for the ID of one of the calendars which kept reappearing. The first couple of times it failed after getting into a never ending loop but after I'd removed the circular referencing links which caused that (which were remnants of a remote access tool) and waiting 48 hours for the script to finish I found most of the results in a very long list pointed to the same place (but via different sets of links).


~/Library/Application Support/SyncServices/Local was the culprit. After deleting that package and the Calendar and CalendarAgent caches the old calendars no longer reappear. Both the list of calendars in Calendar.app and the sub-folders of ~/Library/Calendars only have the actively used calendars.


Similar questions

12 replies
Question marked as Top-ranking reply

May 11, 2021 6:19 PM in response to BDAqua

I finally found the cache.


I did spend time searching the Containers directory but many of the likely named folders had no cache contents and deleting the contents of those I found did not solve the problem.

~/Library/Containers/com.apple.CalendarAgent/data/Library/Caches/com.apple.CalendarAgent/

and

~/Library/Containers/com.apple.iCal/data/Library/Caches/com.apple.iCal/

as well as the 3 files ~/Library/Calendars/Calendar Cache*

were the only ones I found.


~/Library/Containers/com.apple.CalendarFileHandler/Data/Library/Caches

~/Library/Containers/com.apple.CalendarNotification.CalNCService/Data/Library/Caches

~/Library/Containers/com.apple.iCal.CalendarNC/Data/Library/Caches

and several others were empty anyway.


I decided to search ~/ using grep for the ID of one of the calendars which kept reappearing. The first couple of times it failed after getting into a never ending loop but after I'd removed the circular referencing links which caused that (which were remnants of a remote access tool) and waiting 48 hours for the script to finish I found most of the results in a very long list pointed to the same place (but via different sets of links).


~/Library/Application Support/SyncServices/Local was the culprit. After deleting that package and the Calendar and CalendarAgent caches the old calendars no longer reappear. Both the list of calendars in Calendar.app and the sub-folders of ~/Library/Calendars only have the actively used calendars.


May 5, 2021 1:58 AM in response to gakushaburu

I've managed to make some progress but still can't find where the cache is stored.


If I delete the calendars and then delete their subfolders but don't delete the cache files then they don't reappear. If I delete the cache files they all come back which means the data must be stored somewhere else.


I would just leave it at that but still use iTunes to sync these calendars with an iPhone and the list of calendars in the iTunes "Sync Calendars" section still has the full list of calendars even though the old ones don't exist on either the iPhone or the Mac. This can get very confusing as the number of non-existent calendars in the list outnumbers the real ones and for some, the same name appears twice.

May 6, 2021 12:11 AM in response to BDAqua

Thanks for the suggestion but unfortunately it makes no difference. I've been through the whole process in safe mode with several reboots. After deleting the 3 cache files ("Calendar Cache", "Calendar Cache-shm" and "Calendar Cache-wal") and rebooting all of the old folders are recreated (probably by CalendarAgent as this happens before Calendar is opened) and all the old calendars are displayed in Calendar when I open it.


May 6, 2021 1:07 AM in response to gakushaburu

As an experiment I decided to delete the whole Calendars folder from ~/Library after stopping CalendarAgent. When CalendarAgent started again it recreated the folder and the default calendars for a new user which I'd expected.


The unexpected happened after a reboot when all the old calendars came back. I think this only happened when I opened Calendar.app as the contents of the folder looked static for a few minutes before that.


Therefore the information must be coming from another folder but I can't find anything in ~/Library/Caches which looks as if it might be related to Calendar ... nor in Application Support.

May 6, 2021 4:34 PM in response to BDAqua

This user syncs with an iPhone but syncing is done using iTunes and a USB cable and the iPhone has not been connected at any time since I started the clean up. As far as I am aware the only iPhone data stored on the Mac is a set of backups taken before each sync.


These old unwanted calendars are not on the iPhone although some of them been in the past.


There is no syncing with iCloud.

May 6, 2021 5:25 PM in response to BDAqua

Thanks.


Unfortunately, this file contains just two pieces of data which are locations added to events a couple of days ago (in an active calendar). The file timestamp is also from a couple of data ago which was probably when the last sync was done, but the old calendars have reappeared at least three times since then.


However, the Containers folder is not a place that I've looked at in detail as I didn't know what it was (still don't) and the files at slightly higher levels are mostly binary so I can't tell what's in them, but deeper levels look hopeful. I'll see what else I can find in the Containers folder when I've got more time later. There seems to be a collection of caches in ~/Library/Containers/com.apple.corerecents.recentsd/Data/Library/Caches/com.apple.CalendarAgent/ which looks promising.

Where does Calendar keep its caches?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.