How to Configure BranchCache in Windows Server 2022
Posted on 17th June 2023
Introduction
BranchCache is a feature of Windows Server that helps reduce network traffic and improve performance for branch office users who access content from central servers. When BranchCache is enabled, content from central servers is cached on computers at the branch office. This cached content is then available to other users at the branch office, which reduces network traffic and improves performance.
BranchCache can be configured in one of two modes:
- Hosted cache mode – In this mode, a designated computer at the branch office (called a hosted cache server) stores the cached content. Other computers at the branch office (called clients) retrieve content from the hosted cache server.
- Distributed cache mode – In this mode, each computer at the branch office stores a copy of the cached content. When a client computer requests content that is not currently stored on the local computer, the computer retrieves the content from another computer at the branch office that has the content cached (called a peer).
This article describes how to configure BranchCache in Windows Server 2022.
Requirements
To configure BranchCache in Windows Server 2022, you must meet the following requirements:
- A domain controller running Windows Server 2022 or later.
- BranchCache must be enabled on the domain controller and all computers that will act as hosted cache servers or clients.
- The network between the central server and the branch office must be reliable and have sufficient bandwidth.
- If you are configuring BranchCache in hosted cache mode, you must have a computer at the branch office that can be configured as a hosted cache server.
Configuring BranchCache in Windows Server 2022
Configuring BranchCache in Windows Server 2022 is a two-step process:
- Enable BranchCache on the domain controller.
- Enable BranchCache on the computers that will act as hosted cache servers or clients.
Step 1: Enable BranchCache on the Domain Controller
To enable BranchCache on the domain controller, follow these steps:
- Open the Group Policy Management Console.
- Create or edit a Group Policy object (GPO) that is linked to the domain or OU in which the branch office computers are located.
- In the Group Policy Management Editor, expand the following nodes: Computer ConfigurationPoliciesAdministrative TemplatesNetworkBranchCache.
- Enable the following policies:
- Turn on BranchCache
- Allow BranchCache on all drives and enable BranchCache on clients
For more information about these policies, see the “BranchCache Policies” section later in this article.
Step 2: Enable BranchCache on the Computers that will Act as Hosted Cache Servers or Clients
To enable BranchCache on the computers that will act as hosted cache servers or clients, follow these steps:
- Open the Group Policy Management Console.
- Create or edit a Group Policy object (GPO) that is linked to the domain or OU in which the branch office computers are located.
- In the Group Policy Management Editor, expand the following nodes: Computer ConfigurationPoliciesAdministrative TemplatesNetworkBranchCache.
- Enable the following policies:
- Turn on BranchCache
- Specify BranchCache cache location
- Configure BranchCache Peer Discovery for BranchCache clients
- Configure BranchCache for network files
For more information about these policies, see the “BranchCache Policies” section later in this article.
BranchCache Policies
The following policies can be used to configure BranchCache in Windows Server 2022:
- Turn on BranchCache: This policy enables BranchCache on the computer. If this policy is not enabled, BranchCache is disabled on the computer.
- Allow BranchCache on all drives and enable BranchCache on clients: This policy allows BranchCache to be used on all drives on the computer, and enables BranchCache on clients that connect to the computer. If this policy is not enabled, BranchCache is disabled on all drives on the computer, and client computers will not be able to use BranchCache to retrieve content from the computer.
- Specify BranchCache cache location: This policy allows you to specify the location of the BranchCache cache. The cache can be stored on the local hard drive, on a network share, or on a portable storage device. If this policy is not enabled, the cache will be stored on the local hard drive.
- Configure BranchCache Peer Discovery for BranchCache clients: This policy allows you to configure how clients discover peers that have content cached. If this policy is not enabled, clients will use broadcasts to discover peers. If this policy is enabled, you can specify whether clients use broadcasts, multicasts, or both to discover peers. You can also specify the multicast address that clients will use to discover peers.
- Configure BranchCache for network files: This policy allows you to configure how BranchCache handles network files. If this policy is not enabled, BranchCache will cache all network files. If this policy is enabled, you can specify whether BranchCache will cache files from non-Windows file servers, and you can specify the types of files that BranchCache will cache.
Conclusion
Configuring BranchCache in Windows Server 2022 is a two-step process:
- Enable BranchCache on the domain controller.
- Enable BranchCache on the computers that will act as hosted cache servers or clients.
For more information about BranchCache policies, see the “BranchCache Policies” section earlier in this article.
How to Configure BranchCache in Windows Server 2022
Enabling BranchCache
BranchCache can be enabled in one of two ways:
- Group Policy Objects (GPOs)
- Windows PowerShell
Enabling BranchCache using GPOs
- Open the Group Policy Management Console (GPMC).
- Create a new Group Policy Object (GPO) and name it Enable BranchCache.
- Edit the new GPO.
- Navigate to Computer Configuration -> Policies -> Administrative Templates -> Network -> BranchCache.
- Enable the following policies:
- Turn on BranchCache
- Allow BranchCache on all drives
- Allow BranchCache on the following ports
- Configure the port numbers that will be used for BranchCache (the default is port 80 and port 443).
- Link the new GPO to the appropriate Active Directory container (Domain, Site, or OU).
Enabling BranchCache using PowerShell
Enable-BCDistributed
Replace with the name of the server on which you want to enable BranchCache.