In enterprise branch office environments, remote branch workers often retrieve large files, software packages, and corporate intranet assets across high-latency wide area networks (WANs) connected to a central data centre or cloud infrastructure. When multiple local users repeatedly download identical files, WAN bandwidth saturates rapidly. Microsoft BranchCache on Windows 11 Pro and Enterprise addresses this bottleneck by caching content locally. Once the first client retrieves data across the WAN, subsequent requests from adjacent workstations on the same local subnet are served directly from local cache peers or a local hosted cache appliance. Configuring BranchCache via PowerShell gives administrators granular control over operational modes, cache sizing, and performance monitoring.
BranchCache Operational Modes: Distributed vs Hosted Cache
Windows 11 supports two distinct client caching architectures:
- Distributed Cache Mode: Content cache is distributed across local Windows 11 client workstations on the same subnet. Workstations broadcast discovery requests using Web Services Dynamic Discovery (WS-Discovery) over UDP port 3702 to locate and retrieve cached blocks from peer machines without requiring dedicated server infrastructure.
- Hosted Cache Mode: Content is cached on a dedicated local server running Windows Server configured with the Hosted Cache Server role. Windows 11 clients establish secure HTTPS connections (port 443) directly to the local hosted cache server to upload and retrieve content.
- Content Encryption and Privacy: BranchCache never stores raw unencrypted files across peers; data is divided into cryptographic blocks (hashes), and clients must authenticate with the origin content server to obtain the decryption keys before assembling peer-downloaded segments.
Auditing Existing BranchCache Status in PowerShell
Before modifying cache parameters, audit the current BranchCache service state and network configurations using an elevated PowerShell session:
# Query the primary BranchCache service and configuration status
Get-BCStatus
# Check the active operational mode (Distributed, HostedCacheServer, or Disabled)
(Get-BCStatus).BranchCacheIsEnabled
(Get-BCStatus).ClientConfiguration.CurrentClientMode
If the service is stopped or unconfigured, CurrentClientMode will report Disabled.
Configuring Distributed Cache Mode on Windows 11
In branch offices without a dedicated local server, configure workstations to operate in Distributed Cache mode:
# Enable Distributed Cache mode and automatically open necessary Windows Firewall rules
Enable-BCDistributed -Force
# Verify that the BranchCache service (PeerDistSvc) is running
Get-Service -Name PeerDistSvc | Select-Object Name, Status, StartType
The Enable-BCDistributed cmdlet automatically configures the local Windows Defender Firewall rules for BranchCache Peer Discovery (UDP 3702) and Content Retrieval (TCP 80).
Configuring Hosted Cache Client Mode
If your branch office maintains a local hosted cache server (e.g. cache-server.branch.corp):
# Configure the client to use a designated Hosted Cache server
Enable-BCHostedClient -ServerNames "cache-server.branch.corp" -Force
# Query the hosted cache client registration and authentication state
Get-BCStatus | Select-Object -ExpandProperty HostedCacheServerList
Managing Local Cache Sizing and Storage Limits
By default, BranchCache allocates up to 5% of the primary system drive for local data block storage. To adjust the cache size threshold or relocate the cache directory to a secondary high-speed NVMe drive:
# Inspect current data and hash cache directories and allocated sizes
Get-BCCache
# Adjust the maximum cache size percentage (e.g. allocate 10% of total drive space)
Set-BCCache -Percentage 10
# Relocate the cache directory to an alternate drive
Set-BCCache -Path "D:\BranchCache\Data" -MoveExistingData
Monitoring Bandwidth Savings and Performance Counters
To verify whether BranchCache is actively offloading WAN traffic and serving data from peers:
# Query BranchCache performance counters via PowerShell
Get-Counter -Counter "\BranchCache\*" | Select-Object -ExpandProperty CounterSamples | Format-Table Path, CookedValue -AutoSize
Key counters to evaluate include:
- Bytes from Cache: The total volume of data retrieved locally from peers or hosted servers without traversing the WAN.
- Bytes from Server: The volume of data retrieved across the wide area network from the origin server.
- Bytes from Peers: Specifically measures peer-to-peer data transfers in Distributed Cache mode.
Clearing the Local Cache and Resetting Configuration
If obsolete cached data must be purged or if BranchCache needs to be reset to factory defaults:
# Purge all cached data blocks and content hashes immediately
Clear-BCCache -Force
# Disable BranchCache on the client workstation
Disable-BC -Force
# Reset BranchCache configuration back to system default settings
Reset-BC -Force