The Office Desktop Client Apps use the Office Document Cache when accessing documents stored on cloud endpoints such as SharePoint Online / OneDrive.
Caution: Deleting the Office document cache programmatically or by manually navigating to user app data is not recommended. Doing this may lead to Office Client crashes and/or unrecoverable data loss.
-
The default location of this cache is “%LOCALAPPDATA%\Microsoft\Office\16.0\OfficeFileCache” but can be modified using Group Policy as required.
-
The size of the Office Document Cache will vary based on the sizes of files recently opened via the Office Client.
Probable symptoms if the cache (or artifacts within the cache) are deleted
-
Office documents crash unexpectedly when opened from SharePoint Online or OneDrive. This could be immediately after document launch or later while working on the document.
-
File not Found errors.
-
Path not Found errors.
Managing Office Document Cache on Virtual Desktop Infrastructure
Note: Regular cleaning or rebuilding Office Document Cache by following the recommended steps below may cause the file to be redownloaded during the next file open. For large files, this may add time for the file to be fully accessible in the Office Client.
Note: By default, the steps below will not delete items that have pending changes to upload or items with upload errors. If an administrator configures the AgeOutPolicyIncludingFilesPendingUpload policy, files can be removed from the cache even if they still have pending uploads.
For Admins:
Disable Long Term Caching
You can configure Group policies to delete files from the Office Document Cache on document close. This means you may see artifacts in the OfficeFileCache folder created for an open document, which will then be deleted once the document is closed.
Office ADMX references:
HKCU\software\policies\microsoft\office\16.0\common\fileio!disablelongtermcaching
Aging out of documents
Office (when open) will routinely clean out documents deemed old enough to clean, termed “age out.” This age out policy can be configured to clean documents sooner than the default 14 days. Setting the value to 0 will delete documents after they have been closed for an hour.
Office ADMX references:
HKCU\software\policies\microsoft\office\16.0\common\fileio!ageoutpolicy
Note: Both the disableLongTermCaching and AgeOutPolicy regkeys are independent of each other, and do not need to be set simultaneously.
Note: Files are only removed by this policy when there are no pending uploads for that file. To age out files even if they still have pending uploads, see “Age out documents including files with pending uploads” below.
Age out documents including files with pending uploads
Some environments may accumulate cached files that are never removed because they contain pending uploads. You can configure an additional policy to enforce a maximum age for cached documents, including files that may still have pending uploads.
If you enable this policy setting, files older than the value specified by the setting above as well as this setting will be cleaned up regardless of pending upload status.
If you disable this policy setting or do not configure it, Office will continue to clean out only files that do not have pending changes, according to “Age out documents older than n days” policy (AgeOutPolicy).
Office ADMX references:
HKCU\software\policies\microsoft\office\16.0\common\fileio!ageoutpolicyincludingfilespendingupload
Note: Configuring this policy with a value of 0 is considered disabling the policy.
Note: When this policy is configured to a non‑zero value, Office uses the larger value between AgeOutPolicy and AgeOutPolicyIncludingFilesPendingUpload to determine the maximum allowed age for cached files.
For end users:
Within the Office Application, navigate to File > Options > Save > Cache Settings > Delete cached files.
See also
Delete your Office Document Cache Office Document Cache settings