Office 365 OneDrive Offline Cache Size Problem
Office 365 offers 1TB of OneDrive storage to their subscribers for a fairly small fee and according to the rumors soon to be unlimited space. Excellent for backing up your family photos and videos, right? No!
So what’s the problem?
Even if we overlook the fact that the business version of OneDrive actually is a SharePoint site in disguise we have massive issues with uploading a couple of hundred gigs of content. That goes for the home version of OneDrive as well. My setup is pretty common, I run windows on a 512GB SSD and I have another disk on 2TB for storing photos & videos. I installed the application and started uploading ~300 GB photos and videos.
After a couple of hours the sync had failed miserably, the computer was barely workable due to the lack of space on the system disk. Turns out that Office 365 thinks it’s a good idea to create an offline cache in the user AppData-folder (located on the system drive) for every file.
The accepted solution according to the community is to delete the files manually or setting “Days to keep files in the office document cache” to 1. But I couldn’t even do the initial sync!?
My solution
As the files were uploaded we needed to make room on the system drive for new uploads. The cache is located under C:\Users\<user>\AppData\Local\Microsoft\Office\15.0\OfficeFileCache. I threw together a simple console program in 10 minutes that deletes cache files older than 5 minutes. I’ve made the source code and a compiled dist version available on github here. It could be a good idea to always run it as a service, but I’ll leave that for a later exercise. It’s very straightforward and not complicated at all, more importantly it does the job.
UPDATE
I changed the implementation so it runs as a windows service and it’s installed with a msi.
Hope it helps.
By the way…
I switched to google drive instead since the business version of onedrive just lists the files in a list á la sharepoint style. No thumbnails, no viewing images or playing videos in the browser, can’t even download an entire folder as a zip file. Pretty useless, just like sharepoint.