> 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/mom/operations/caching-and-peering.md).

# Caching and peering

How MOM handles downloads from day to day, and the settings that change it. Settings are named as they appear in the Configuration Editor.

## What to expect

* **The first client of a new file gets it through MOM from the origin.** MOM keeps a copy.
* **Later clients get it from peers.** MOM gives them the Content Information (CI). They ask MOM only for parts no peer has.
* **Clients without BranchCache get it from MOM's copy.** They do not peer.

The origin is asked once per file.

## Downloads MOM does not handle

MOM forwards these like an ordinary proxy and keeps nothing:

* Requests other than GET and HEAD
* Hosts excluded by the white list or the black list
* Files smaller than 10 MB
* Content types excluded by the content type filter
* Servers that support BranchCache themselves. Clients peer with those directly, with or without MOM

To change the limits, see [Limit what MOM handles](https://documentation.2pintsoftware.com/mom/operations/tuning.md#limit-what-mom-handles).

## Sharing sooner

Two features shorten the time before clients can share a new file:

* **Prefetch** (on by default). When a client asks for a new file, MOM downloads the whole file itself, at its own speed. The first BITS client waits for up to three minutes and then receives the CI.
* **Live CI** (managed mode only). MOM creates the CI while the download is still running. Clients that ask for the same file get CI for the part that is ready.

## While a download is running

A second client can ask for a file before the first download has finished.

| Setting in the editor                            | Default | What it does                                                                  |
| ------------------------------------------------ | ------- | ----------------------------------------------------------------------------- |
| **Serve files from MOM temp folder if possible** | On      | MOM sends the second client the parts it already has                          |
| **Postpone bits request if already in progress** | On      | MOM holds a second BITS client until the CI is ready, for at most 480 seconds |

If the wait runs out, MOM answers BITS with an error. BITS then tries again by itself.

## When the first client stops

MOM cannot see that a BITS job was cancelled or paused. If no data arrives for three minutes, MOM stops waiting for that client, and the next client starts the download again.

With prefetch on, this rarely matters: MOM downloads the file itself.

## Complete files

MOM keeps complete files and serves parts of them to clients. This is **Serve files from MOM static folder if applicable**, on by default.

With the setting off, MOM keeps only the CI. Requests for data then go to the origin.

## Cleanup

MOM cleans up every five minutes.

| What                          | Deleted when          | Setting in the editor                                                                                     |
| ----------------------------- | --------------------- | --------------------------------------------------------------------------------------------------------- |
| Parts of unfinished downloads | Not used for 48 hours | **Delete temporary files after last accessed time (seconds)**                                             |
| Complete files                | Not used for 48 hours | **Delete local stored files after last accessed time (seconds)**, when **Delete local stored file** is on |

The CI is kept, so clients still receive it and peer.

## If the disk fills up

MOM has no size limit for the content it keeps and does not check free disk space. It only deletes by age.

When the disk is full:

* Downloads of new files through MOM fail, because MOM cannot keep a copy. The client retries, and fails again until there is room.
* Files MOM already has are still served, and clients that received CI still peer.

To avoid it, keep the data folder on its own volume, size it as described in [Prerequisites](https://documentation.2pintsoftware.com/mom/planning/prerequisites.md#disk), and monitor its free space. To recover, see [The disk fills up](https://documentation.2pintsoftware.com/mom/troubleshooting/overview.md#the-disk-fills-up).


---

# 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/mom/operations/caching-and-peering.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.
