Configuring BranchCache in Windows Server 2012

By | May 23, 2014

Understanding BranchCache

  • Solves the problem with Branch Offices connected to a main office via slow WAN links.  Helps with users whom complain about slow HTTP and SMB downloads.
  • The caching server can work with Server 2008/2012 and Win 7/8.
  • Uses HTTP(S), SMB, BITS, and ESE DB (Extensible Storage Engine Database)
  • There are two modes – Hosted and Distributed.  Hosted cache has a BranchCache server in each site which is empowered using Group Policy.  The BC server will retrieve it from your centralized File/Web Server and cache the content.  Hosted cache also works across various subnets, which is a big advantage.  Distributed Cache doesn’t use any server at a remote site.  Instead it uses P2P technology for client caching using Multicast.  Because it uses multicast, it can not work across multiple subnets since it is layer 2 technology.  However you do gain a cost savings.

How Does Branch Cache work?

  1. Client Computer in branch office connects to content server in main office.
  2. Content Server authenticates/authorizes the user and sends hash IDs to the client.
  3. Client then multicasts (distributed) or unicasts (hosted) to the cache content/server.  The hash ensures the file is the same in both locations.  If the file was modified, the caching server would fetch the correct file.
  4. Content delivered live or from cache store.

BranchCache Setup Workflow:

  1. Server configuration – Install BranchCache on host servers, config BranchCache via GPO, then mark file shares for BranchCache.
  2. Client configuration – Enable and tweak BranchCache via GPO.  Make Windows Firewall allowances for BranchCache.
  3. Monitoring configuration – Configure Event Viewer and Operational logs as well as BranchCache performance counters if needed.

 BranchCache and FCI (File Classification Infrastructure):

  • Lets you integrate with Dynamic Access Control
  • Allows you to manage Access Denied Assistance
  • Allows you to auto classify files using Classification rules and properties such as files that contain SSN’s, Credit Cards, etc.  Also lets you use RMS to encrypt files as needed.

Other Improvements:

  • File access audting has been improved with expression based audit policies and additional information for logins and object access.  Picks up file attributes to provide more information
  • Support for NFS (Network File System).  Allows better Linux and VMWare integration.  Also integrates with failover clustering.

How to Configure BranchCache:

  • First, create a share on your File Server and/or some web site content via IIS.
  • Open the Group Policy Management Console to create a GPO for BranchCache client settings.  The GPO needs to be configured to turn on BranchCache as well as the mode you will be using.  This policy should be applied to your client computers and servers that will be using BranchCache.  Also, be sure to enable the appropriate inbound rules for Windows firewall.  Lastly, be sure to enable hash publishing for BranchCache.
  • Install BranchCache for Network Files under File and Storage Services in Server Manager.  Also, install the BranchCache feature on your file server.
  • On your BranchCache server(s) (whether distributed or hosted) install BranchCache feature by running powershell command get-windowsfeature branchcache | install-windowsfeature.
  • get-bcstatus will give you the status of your BranchCache service.  Be sure the content server is enabled.
  • To generate hashes for your web content being cached, run publish-bcwebcontent C:\inetpub\wwwroot (or where ever the web content is stored).
  • If you would like to export a prestaged copy of your cached content, you can run export-bccachepackage.
  • Now, on the BranchCache server, register it as a service connection point by using enable-bchostedserver -registerSCP.
  • get-bcstatus will ensure the the cache server is enabled on this server.
  • Once group policy updates, restart the branch cache service using get-service peerdistsvc | restart-service on cache server and file server.