It’s 2Pint Friday – which means another quick and dirty post before we adjourn to the Pub..
So how can you resize the BranchCache Hash Cache using PowerShell?
This question came up on the TechNet forums so here’s the answer, as it’s not too obvious from them pesky BranchCache docs. Please note that this works for WS2012/Windows 8/10. For WS2008/Windows 7 you will have to stick with good old NetSh commands as shown here – https://technet.microsoft.com/en-us/library/dd979561(v=ws.10).aspx
Firstly, there are two BranchCache Caches right? The ‘Hash Cache’ and the ‘Data Cache’. If you run get-bcstatus in PowerShell, you should see output like this, which will tell you where the cache folders reside, and how they are configured for size etc.
By default, the good old Hash Cache is only set to use 1% of the disk , which is fine on Windows clients, as they don’t actually publish the Hashes, but on the content servers, when there are TerraBytes of content to Hash up – running out of Hash Cache space can be a complete PITA and will result in BranchCache breaking and lots of Event 13 in your Application Event log….
So, on to business. To configure the Hash Cache with PowerShell, See below.
Here’s the code..
get-bchashcache | set-bccache -Percentage 10
To do the same for the DataCache would be
get-bcdatacache | set-bccache -Percentage 10
So, Happy BranchCaching, and remember, Big HashCache, small DataCache on the content server, and the opposite on the clients!