Subscribe to Windows IT Pro

 

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

May 21, 2009 12:00 AM

Q. How do I enable BranchCache?

Windows IT Pro
InstantDoc ID #102131
Rating: (0)

A. BranchCache, described in this FAQ, must be enabled on your clients to instruct them which type to use (hosted or distributed cache). You must also create the required firewall exceptions and ensure that the files you wish to be cacheable have a hash generated on them. The easiest way to configure BranchCache is via Group Policy.

First, you need to make the server hosting the data generate hash values.

  1. Open a Group Policy Object.
  2. Navigate to Computer Configuration, then Policies, Administrative Templates, Network, Lanman Server.
  3. Double-click Hash Publication for BranchCache.
  4. Set this to Enabled, then configure when the hash should be generated, as shown here. You can generate hashes if a folder is shared and enabled for cache (recommended), never generate a hash, or generate a hash for every shared folder. Make a choice and click OK.
  5. Click to expand.

If you configured the server to generate a hash only if a shared folder is set to use caching, you need to

  1. Right-click the shared folder in Explorer and select Properties.
  2. Select the Sharing tab.
  3. Click the Advanced Sharing button.
  4. Click the Caching button.
  5. Check the Enable BranchCache option, as shown here, and click OK to close all dialogs.
  6. Click to expand.

You can also use the hashgen command to force a hash generation for other files, such as web files served via HTTP.

If you're using hosted cache, you now need to enable the BranchCache feature on a Server 2008 R2 server. For this walkthrough, I'll configure distributed cache (peer to peer).

The next step is to enable BranchCache on the clients. Again, I'll use Group Policy.

  1. Navigate to Computer Configuration, then Policies, Administrative Templates, Network, BranchCache.
  2. Double-click Turn on BranchCache and set it to Enabled.
  3. Because you're using distributed BranchCache, double-click Set BranchCache Distributed Cache mode and set it to Enabled.
  4. You can also configure the latency required before caching is used. You probably don't want to cache data if the connection is very fast, so you might only cache if the latency is over 70 ms. Double-click Configure BranchCache for network files, set it to Enabled and set the latency. In the example here, I set latency to 0, so everything is cached.

    Click to expand.

  5. Note that you can also set the amount of disk space to be used for the cache on clients. The default value is 5 percent. Use the Set percentage of disk space used for client computer cache option to set this value.

Now you need to enable two firewall rules.

  1. Navigate to Computer Configuration then Policies, Windows Settings, Windows Firewall with Advanced Security, Inbound Rules.
  2. Select New Rule from the right-click menu.
  3. Under HTTP, Port, TCP 80, create a rule to allow all profiles (or just a domain, depending on environment). Also create a rule under WS-Discovery, Port, UDP 3702 to allow all profiles (or, again, just a domain), as shown here.

    Click to expand.

  4. Close the GPO

At this point, you have a GPO with all the required settings. Make sure the GPO is linked to the client and the client refreshes its policy, either by rebooting or using the command gpupdate /force.

You can check if BranchCache is enabled on a client using the command netsh branchcache show status. You can also directly enable BranchCache using netsh commands such as

netsh branchcache set service mode=distributed
or
netsh branchcache set service mode=hostedclient location=<hosted cache server>
Related Reading:

Check out hundreds more useful Q&As like this in John Savill's FAQ for Windows. Also, watch instructional videos made by John at ITTV.net.

Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

White Papers

Get your Windows 7 deployment off to the right start by implementing PC lockdown. A locked-down environment is easier and cheaper to support since users are less likely to make unnecessary changes to the core system configuration - read more here!

Essential Guides

Is your iSCSI "lossy"? The reality is that most off-the-shelf Ethernet hardware deployed for iSCSI can lose packets, resulting in slow performance or application downtime. Learn how to assess your current iSCSI infrastructure and engineer an advanced iSCSI SAN infrastructure.

Web Seminars

What's the best way to keep your network safe from malware? In this web seminar, security expert Greg Shields suggests an alternative method to the traditional blacklisting approach that is common with anti-virus and anti-malware solutions.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.