What Delivery Optimization Disk Cleanup Actually Does
Delivery Optimization is Windows built-in peer-to-peer update distribution. It caches downloaded updates locally so your machine can serve them to other devices on the same network. Over time those caches pile up and take up space. The Delivery Optimization Disk Cleanup process just removes that cached data. There is not much mystery to it, but there are a few things most people miss when they go to clean it out. Open Settings, go to System, then Storage. Click on Temporary Files. Windows will scan for a moment and then you will see Delivery Optimization as one of the options. Check the box and click Remove files. That is the basic path, and it works for most users. For a more complete cleanup you need to use PowerShell instead. Open an elevated prompt and run Clear-DeliveryOptimizationCache. This clears everything in one shot. If you want to verify how much space is actually being held before you wipe it, check the cache directory at C:\ProgramData\Microsoft\Windows\DeliveryOptimization. The folders there contain the actual cached content.
I ran into an issue last year on a fleet of about two hundred machines where the Delivery Optimization cache would not clear through Settings or the PowerShell command. The folder sat at around 8.5 gigabytes and was not shrinking at all. What was happening is the service had a file lock from a stuck BITS transfer. The normal cleanup methods just skipped it silently. The workaround was to stop the DeliverOptimization service first, then kill the related bitsadmin processes, then run the PowerShell clear command, and finally restart the service. Took about ninety seconds total per machine once I figured out the pattern. Before that I was running cleanup scripts that took three minutes and did absolutely nothing. There is a registry key that controls the maximum cache size. It is at HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config. The DODownloadMode value determines how the cache behaves, and the values that matter are 3 for purely local peer caching and 4 for internet peer caching plus peer-to-peer from Microsoft. If you are dealing with a machine that only handles local traffic and you want the cache to stay small, setting the config with Set-DeliveryOptimizationConfig and adjusting those parameters can keep the cache from growing past whatever threshold you set. The cache defaults to roughly 5 gigabytes on most systems. One thing people do not expect is that cleaning the Delivery Optimization cache does not remove the actual downloaded update packages from Windows Update history. Those are stored separately. If you need to free up space from old .msu or .cab files, that requires a different cleanup pass through Disk Cleanup in administrator mode or using the WSUS content cleanup if you manage updates through a server.
The real limitation here is that this only helps if you are seeing high cache usage. On a single home PC that rarely shares updates with other devices on the network, the cache might sit at under half a gigabyte and be completely irrelevant to your storage problems. Running this cleanup on such a machine is fine but you should not expect to reclaim anything meaningful. Also, if you have Windows Update for Business configured with a delivery optimization policy through Intune or SCCM, the cache behavior may be governed by the group policy settings and the manual cleanup might get immediately repopulated depending on your DL mode and bandwidth throttling configuration. I have seen this happen on machines where the cache would fill back up to its previous size within forty minutes after a major feature update cycle because the policy was forcing aggressive peer sharing across the subnet. If you are on Windows 10 version 2004 or later and want a fully automated approach, you can add Delivery Optimization to the Windows Scheduled Cleanup tasks by creating a scheduled task that runs Clear-DeliveryOptimizationCache on a weekly basis. I set one up on our workstation images and it has kept the cache under 2 gigabytes across the board without any manual intervention. The main pitfall to watch for is assuming this cleanup will fix slow Windows Update downloads. Clearing the cache can actually make downloads slower on the next run because the local cache hit is gone and the machine has to re-download everything from Microsoft's servers instead of serving it from the local peer cache. If your concern is update speed rather than disk space, leave the cache alone or at least do not clear it right before a planned mass deployment of a large feature update.
Get the Full Details
