Skip to main content

Disable or enable BranchCache on an ONTAP SVM

Contributors netapp-aherbin netapp-aaron-holt

If you previously configured BranchCache but do not want the branch office clients to use cached content, you can disable caching on the CIFS server. You must be aware of what happens when you disable BranchCache. You can disable BranchCache on the storage virtual machine by changing the BranchCache operating mode to disabled. You can enable BranchCache at any time by changing the operating mode to either offer BranchCache services per-share or automatically for all shares.

When you disable BranchCache, ONTAP no longer computes hashes or sends the metadata to the requesting client. However, there is no interruption to file access. Thereafter, when BranchCache-enabled clients request metadata information for content they want to access, ONTAP responds with a Microsoft-defined error, which causes the client to send a second request, requesting the actual content. In response to the request for content, the CIFS server sends the actual content that is stored on the storage virtual machine (SVM).

After BranchCache is disabled on the CIFS server, SMB shares do not advertise BranchCache capabilities. To access data on new SMB connections, clients make normal read SMB requests.

You can reenable BranchCache on the CIFS server at any time.

  • Because the hash store is not deleted when you disable BranchCache, ONTAP can use the stored hashes when replying to hash requests after you reenable BranchCache, provided that the requested hash is still valid.

  • Any clients that have made SMB connections to BranchCache-enabled shares during the time when BranchCache was disabled do not get BranchCache support if BranchCache is subsequently reenabled.

    This is because ONTAP advertises BranchCache support for a share at the time the SMB session is set up. Clients that established sessions to BranchCache-enabled shares while BranchCache was disabled need to disconnect and reconnect to use cached content for this share.

Note

If you do not want to save the hash store after you disable BranchCache on a CIFS server, you can manually delete it. If you reenable BranchCache, you must ensure that the hash store directory exists. After BranchCache is reenabled, BranchCache-enabled shares advertise BranchCache capabilities. ONTAP creates new hashes as new requests are made by BranchCache-enabled clients.

Steps
  1. Run the appropriate command:

    If you want to…​ Then enter the following…​

    Disable BranchCache

    vserver cifs branchcache modify -vserver vserver_name -operating-mode disable

    Enable BranchCache per share

    vserver cifs branchcache modify -vserver vserver_name -operating-mode per-share

    Enable BranchCache for all shares

    vserver cifs branchcache modify -vserver vserver_name -operating-mode all-shares

  2. Verify that the BranchCache operating mode is configured with the desired setting: vserver cifs branchcache show -vserver vserver_name

Example

The following example disables BranchCache on SVM vs1:

cluster1::> vserver cifs branchcache modify -vserver vs1 -operating-mode disable

cluster1::> vserver cifs branchcache show -vserver vs1

                                 Vserver: vs1
          Supported BranchCache Versions: enable_all
                      Path to Hash Store: /hash_data
          Maximum Size of the Hash Store: 20GB
Encryption Key Used to Secure the Hashes: -
        CIFS BranchCache Operating Modes: disable