> For the complete documentation index, see [llms.txt](https://documentation.2pintsoftware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.2pintsoftware.com/2pxe-server/4.0/configuration/branchcache-setup.md).

# BranchCache Setup

Installing and configuring the optional Windows BranchCache feature on the 2PXE server, for peer-to-peer (P2P) downloads of files served by 2PXE.

2PXE serves boot files and boot images from its own built-in web service (Kestrel), so IIS is not needed on the 2PXE server.

BranchCache is optional. It is only needed if you want iPXE clients to download files served by 2PXE from BranchCache peers instead of from the 2PXE server. The 2PXE web service uses the Windows BranchCache APIs for this, so if peering is enabled in 2PXE (the default) but the BranchCache feature is not installed and enabled on the 2PXE server, peering does not work.

The 2PXE BranchCache setup only applies to the files that 2PXE itself serves:

* Boot files, such as the iPXE `.efi` files and wimboot.
* Boot images served by 2PXE for the [PowerShell request handler](/2pxe-server/4.0/configuration/2pxe-config-file/powershell-request-handler.md).

Boot images downloaded from a Configuration Manager distribution point or from a DeployR server are not served by 2PXE. BranchCache for that content is configured separately, on the distribution point or the DeployR server.

## Install and enable BranchCache

From an elevated PowerShell prompt, install the BranchCache feature and enable BranchCache in distributed cache mode:

```powershell
Install-WindowsFeature BranchCache
Enable-BCDistributed
```

Installing and enabling BranchCache this way also configures the BranchCache service and the required Windows Firewall rules, so no other configuration is needed.

After BranchCache is enabled, restart the "2Pint 2PXE Server" service.

## Turning peering off

Peering is controlled by the **DisablePeerDist** setting in the **Configure 2PXE** configuration editor (see [Configuring 2PXE Server](/2pxe-server/4.0/configuration/2pxe-config-file.md)). It is off by default, which means that peering is enabled. If you do not want to use BranchCache for files served by 2PXE, turn **DisablePeerDist** on.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://documentation.2pintsoftware.com/2pxe-server/4.0/configuration/branchcache-setup.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
