Client Configuration

BranchCache is disabled by default on client computers. Take the following steps to enable BranchCache on client computers:

  1. Turn on BranchCache.

  2. Enable either Distributed Cache mode or Hosted Cache mode.

  3. Configure the client firewall to enable BranchCache protocols.

Enabling Distributed Cache or Hosted Cache mode (step 2) without explicitly enabling the overall BranchCache feature (step 1) will leave BranchCache disabled on a client computer.

It is possible to enable BranchCache on a client computer (step 1) without enabling Hosted Cache mode or Distributed Cache mode (step 2). In this configuration, the client computer only uses the local cache and will not attempt to download from peers or from a Hosted Cache server. Multiple users of a single computer will benefit from a shared local cache in this local caching mode.

Configuration can be automated using Group Policy or can be achieved manually by using the netsh command. This section describes both configuration approaches.

Client configuration using Group Policy

To enable BranchCache on Windows 7 client computers using Group Policy, you must first create a Group Policy object (GPO) that will carry the BranchCache configuration. After creating the GPO, you configure the setting that enables BranchCache and choose whether BranchCache will operate in Distributed Cache mode or Hosted Cache mode.

To create a GPO, enable BranchCache, and select the cache mode

  1. Click Start, point to Administrative Tools, and click Group Policy Management Console.

  2. In the console tree, select the domain in which you will apply the GPO.

  3. Create a new GPO by selecting New from the Action menu.

  4. Choose a name for the new GPO, and then click OK.

  5. Right click the GPO you created and choose Edit.

  6. Click Computer Configuration, point to Policies, Administrative Templates: Policy definitions (ADMX files) retrieved from the local machine, Network, and then click BranchCache.

  7. Double-click Turn on BranchCache.

  8. Click Enabled, and then click OK.

  9. To use Distributed Cache mode, double-click Turn on BranchCache – Distributed Caching mode, click Enabled, and then click OK.

    –or–

    To use Hosted Cache mode, double-click Turn on BranchCache – Hosted cache mode, click Enabled, and then click OK.

  10. To enable BranchCache for SMB traffic, double-click BranchCache for network files, click Enabled, select a latency value under Options, and then click OK.

Configuring the client firewall

To support IKEv2-enabled VPN connections, first install the Active Directory Certificate Services and Web Server (IIS) server roles to enable Web enrollment of a computer certificate.

In Distributed Cache Mode, BranchCache uses the HTTP protocol for data transfer between client computers and the WS-Discovery protocol for cached content discovery. The client firewall must be configured to allow incoming HTTP and WS-Discovery traffic on computers that use Distributed Cache mode.

The HTTP protocol is also used by clients configured to use the Hosted Cache mode, but the WS-Discovery protocol is not. Clients operating in Hosted Cache mode must be configured to allow incoming HTTP traffic from the Hosted Cache server.

This section explains how to configure the host firewall using Group Policy to enable BranchCache.

To configure firewall rules for BranchCache using Group Policy

  1. Click Start, point to Administrative Tools, and click Group Policy Management Console.

  2. Right click the GPO you created for BranchCache and choose Edit.

  3. Click Computer Configuration, point to Policies, Windows Settings, Security Settings, Windows Firewall with Advanced Security, and then click Inbound Rules.

  4. Create a firewall rule for HTTP (required in both Distributed Cache and Hosted Cache modes):

    1. From the Action menu, select New.

      • If you are authoring the Group Policy object on a computer that is running Windows Server 2008 R2 or Windows 7:Click Predefined, select BranchCache – Content Retrieval (Uses HTTP), and then click Next.

      • If you are authoring the Group Policy object on a computer that does not include the predefined BranchCache firewall rules:Click Port, and then click OK. Click TCP, click Specific local ports, type 80 in the text box, and then click Next.

    2. Click Allow the connection, and then click Next.

    3. Choose the networks in which the rule will apply. In most cases, it is appropriate to select the Domain profile, and leave the Private and Public profiles unselected.

    4. Type a name for the firewall rule, and then click Finish.

  5. Create a firewall rule for WS-Discovery (only required in Distributed Cache mode):

    1. From the Action menu, select New.

      • If you are authoring the Group Policy object on a computer that is running Windows Server 2008 R2 or Windows 7:Click Predefined, select BranchCache – Peer Discovery (Uses WSD), and then click Next.

      • If you are authoring the Group Policy object on a computer that does not include the predefined BranchCache firewall rules:Click Port, and then click OK. Click UDP, click Specific local ports, type 3702 in the text box, and then click Next.

    2. Click Allow the connection, and then click Next.

    3. Choose the networks in which the rule will apply. In most cases, it is appropriate to select the Domain profile, and leave the Private and Public profiles unselected.

    4. Type a name for the firewall rule, and then click Finish.

Client configuration using netsh

When configuring client computers, you can enable BranchCache and choose between Distributed Cache mode and Hosted Cache mode with a single netsh command.

Note

Group Policy overrides netsh configuration.

To enable BranchCache in Distributed Cache mode

  1. Open an elevated Command Prompt window (click the Start button, type command in the Start Search box, right-click Command Prompt, and then click Run as administrator).

  2. Run the following command: netsh branchcache set service mode=DISTRIBUTED

Note

Running this command automatically configures the host firewall for Distributed Cache mode.

To enable BranchCache in Hosted Cache mode

  1. Open an elevated Command Prompt window (click the Start button, type command in the Start Search box, right-click Command Prompt, and then click Run as administrator).

  2. Run the following command: netsh branchcache set service mode=HOSTEDCLIENT LOCATION=<Hosted Cache name>. Where <Hosted Cache name> is the fully qualified domain name of the computer serving as a Hosted Cache.

Note

Running this command automatically configures the host firewall for Hosted Cache mode.