> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bitiful.com/en/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bitiful.com/_mcp/server.
> If something on this page is wrong or missing, POST JSON {"page": "<page URL>", "message": "<what is wrong>"} to https://docs.bitiful.com/_biti/feedback/agent.

# App and game distribution

> Distribute installers and assets for apps, desktop software, and games: versioned directories and overwrite-safe releases, installer downloads as attachments, signed links for beta builds, caching for hot-update assets, prefetch before release, global nodes, download cost control, and traffic monitoring on release day.

Installers and game assets are **large and released in bursts**: in the few hours after a new version ships or a server launches, downloads run many times higher than usual. Distribution has to be **fast and stable**, keep third-party sites from hotlinking installers and beta builds from leaking, and avoid accidentally overwriting a version that's already released.

## Typical challenges

| Challenge             | What it looks like                                                                               |
| --------------------- | ------------------------------------------------------------------------------------------------ |
| Release peaks         | Massive downloads the moment a new version ships strain the origin and bandwidth                 |
| Accidental overwrites | A packaging script runs twice and overwrites an installer that's already released                |
| Download experience   | The browser opens the installer as text, or the downloaded file name is wrong                    |
| Beta leaks            | Links to beta builds get forwarded to public channels                                            |
| Hotlinking            | Third-party download sites link directly to your installers, and you pay for the traffic         |
| Overseas players      | Downloads are slow for overseas users                                                            |
| Hot updates           | Asset bundles update often and must take effect quickly while still making full use of the cache |

## Industry examples

> **Note**
>
> The products mentioned here only illustrate common needs in the industry and don't imply that they use Bitiful.

### Update day for a major mobile game: open-world games like Genshin Impact

**Background**: Asset packages for a major version update are often several GB. In the few hours after the update opens, huge numbers of players download at once, and overseas players pour in at the same time.

**How Bitiful helps**:

- Put asset packages in separate directories by version number. Versioned files are cached for a long time, and only the version manifest isn't cached;
- Before the update opens, [prefetch](https://docs.bitiful.com/en/cdn/handbook/cache.md) the new assets to nodes on the **Cache purge** page, and turn on global nodes to cover overseas players;
- On update day, watch bandwidth at 1-minute granularity in [Usage](https://docs.bitiful.com/en/console/usage.md), filter failed downloads by status code in [Live logs](https://docs.bitiful.com/en/console/access-logs.md), and expand them to see the region and client;
- To roll back, just change the version manifest back to the old version. The old assets are still in the cache and in storage.

**Result**: The moment the update opens, there's no need to fetch from the origin and compete for bandwidth, failed downloads can be pinpointed on the spot, and rolling back takes changing just one file.

### Direct-install packages on the official websites of global apps

**Background**: Many apps and tools aimed at overseas markets offer APK, DMG, and EXE direct-install packages on their official websites. Third-party download sites often link directly to these installer URLs, leaving the developer to pay for the traffic, and links to beta builds leak easily too.

**How Bitiful helps**:

- Distribute installers through a [CDN domain](https://docs.bitiful.com/en/cdn/handbook/domains.md) (the bucket's default domain can't serve `.apk` or `.ipa` downloads). Download links carry [`response-content-disposition`](https://docs.bitiful.com/en/cdn/handbook/performance.md#rewrite-response-headers-with-link-parameters) so browsers download them directly with the correct file name, and edge rules limit per-connection speed;
- [Referer hotlink protection](https://docs.bitiful.com/en/cdn/handbook/access-control.md) refuses embedding by third-party download sites, and the beta directory requires an [advanced authentication](https://docs.bitiful.com/en/best-practice/token-link.md) signature;
- The release system writes official versions with `If-None-Match: *`, so even if a packaging script runs by mistake, it can't overwrite an installer that's already released.

**Result**: Downloads are faster and more stable, hotlinking traffic disappears, beta builds stop leaking, and releases are safer.

## What each part of Bitiful does

| Capability                                                                                                                                                                              | What it does here                                                                                                                                                    |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [S4 object storage](https://docs.bitiful.com/en/bitiful-s4/intro.md)                                                                                                                    | Stores installers and asset bundles for every version. A single file can be up to hundreds of TiB, and past versions are kept without tiers                          |
| [Multipart upload](https://docs.bitiful.com/en/bitiful-s4/handbook/upload.md)                                                                                                           | The build system uploads large installers concurrently and can retry a single failed part                                                                            |
| [Conditional requests](https://docs.bitiful.com/en/developer/s3/conditional-requests.md)                                                                                                | Releases carry `If-None-Match: *`, so an existing version isn't overwritten                                                                                          |
| [Sub-user permissions](https://docs.bitiful.com/en/bitiful-s4/handbook/permissions.md)                                                                                                  | CI can write only to `builds/`, and only the release system can write to `releases/`                                                                                 |
| [Simul-Transfer](https://docs.bitiful.com/en/bitiful-s4/features/simul-transfer.md)                                                                                                     | Testers download internal build artifacts while they're still uploading                                                                                              |
| [CDN](https://docs.bitiful.com/en/cdn/intro.md)                                                                                                                                         | Public installer downloads must go through the CDN (the bucket's default domain can't serve `.apk` or `.ipa` files). Nearly 3,000 nodes, with global nodes available |
| [Rewrite response headers with link parameters](https://docs.bitiful.com/en/cdn/handbook/performance.md#rewrite-response-headers-with-link-parameters)                                  | Links carry `response-content-disposition`, so installers download directly with the file name you set                                                               |
| [Edge rules: CORS and speed limit](https://docs.bitiful.com/en/cdn/handbook/rules.md)                                                                                                   | Limit per-connection speed to control costs                                                                                                                          |
| [Edge rules: blocking](https://docs.bitiful.com/en/cdn/handbook/access-control.md)                                                                                                      | Referer hotlink protection, blocking third-party download sites, and controlling distribution by region                                                              |
| [Advanced authentication](https://docs.bitiful.com/en/best-practice/token-link.md)                                                                                                      | Beta builds can be downloaded only through links with a signature and an expiry                                                                                      |
| [Cache rules](https://docs.bitiful.com/en/cdn/handbook/rules.md)                                                                                                                        | Cache versioned installers and assets for a long time, and don't cache the version manifest                                                                          |
| [Purge and prefetch](https://docs.bitiful.com/en/cdn/handbook/cache.md)                                                                                                                 | Push the new version to nodes before release, and purge the version manifest after release                                                                           |
| [Certificate Center](https://docs.bitiful.com/en/certs-center/intro.md)                                                                                                                 | Auto-renews the download domain's HTTPS certificate, so an expired certificate doesn't break updates                                                                 |
| [Usage](https://docs.bitiful.com/en/console/usage.md) / [Top content](https://docs.bitiful.com/en/console/popular.md) / [Live logs](https://docs.bitiful.com/en/console/access-logs.md) | Watch bandwidth by the minute on release day, and investigate the status codes and regions of failed downloads                                                       |

## Recommended architecture

### Versioned directories

```text
builds/{branch}/{buildNumber}/app.apk         CI build artifacts (internal)
releases/{version}/app-{version}.apk          Release installers
releases/{version}/app-{version}.dmg
hotfix/{assetVersion}/{assetBundle}.bundle    Hot-update assets
latest.json                                   Version manifest
```

File names include the version number and their contents never change, so they're safe to cache for a long time. Only `latest.json` gets updated.

### CI uploads and overwrite protection

CI uploads build artifacts with a [sub-user](https://docs.bitiful.com/en/bitiful-s4/handbook/permissions.md) that can write only to `builds/`. The release system copies packages that pass testing to `releases/` with [`If-None-Match: *`](https://docs.bitiful.com/en/developer/s3/conditional-requests.md#conditional-copy-and-move) on the write. If the target already exists, it returns 412, so a released version isn't overwritten.

### Configure the download domain

Bind a [CDN domain](https://docs.bitiful.com/en/cdn/handbook/domains.md) and turn on [HTTPS](https://docs.bitiful.com/en/cdn/handbook/https.md). If you have many overseas users, choose global nodes. Set these [edge rules](https://docs.bitiful.com/en/cdn/handbook/rules.md):

```text
# CORS and speed limit: limit per-connection speed for installers
http.request.uri.path.extension in {"apk" "ipa" "dmg" "exe" "zip"}

# Cache: don't cache the version manifest
http.request.uri.path eq "/latest.json"

# Advanced authentication: require signatures for the beta directory
starts_with(http.request.uri.path, "/beta/")
```

Then add [Referer hotlink protection](https://docs.bitiful.com/en/cdn/handbook/access-control.md) and third-party download site blocking as needed. Generate signed links for the beta directory with [advanced authentication](https://docs.bitiful.com/en/best-practice/token-link.md).

### Prefetch before release

After the new version is uploaded and before you update `latest.json`, [prefetch](https://docs.bitiful.com/en/cdn/handbook/cache.md) the new installer URLs on the **Cache purge** page so nodes cache them in advance.

### Switch versions

Update `latest.json` to point to the new version and submit a [URL purge](https://docs.bitiful.com/en/cdn/handbook/cache.md) for that file. Clients read the manifest and download from the new address.

### Monitor on release day

In [Usage](https://docs.bitiful.com/en/console/usage.md), watch bandwidth and status codes at 1-minute granularity. In [Live logs](https://docs.bitiful.com/en/console/access-logs.md), filter by status code for 4xx and 5xx, and expand failed requests to see their region and User-Agent.

## Key practices

### Why installers should go through the CDN

The bucket's default domain has a single-thread speed limit, forces downloads in the browser, and can't serve installers such as `.apk` and `.ipa`, so it's only suitable for testing and programmatic reads and writes. Use a CDN domain for public distribution. See [Limits](https://docs.bitiful.com/en/bitiful-s4/limits.md).

### Control download costs

| Practice                   | Effect                                                                                                                                  |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| Per-connection speed limit | Barely noticeable for normal downloads, while multi-threaded downloaders can't multiply bandwidth without limit                         |
| Referer hotlink protection | Traffic from third-party download sites is rejected outright                                                                            |
| Block unusual User-Agents  | Stops bulk scraping                                                                                                                     |
| Resource packages          | Buy [resource packages](https://docs.bitiful.com/en/prices/handbook/resource-packages.md) before release season to lower the unit price |

### Hot-update assets

Asset bundles go in separate directories by version number, and clients download the changed assets according to the manifest. Asset files are cached for a long time, and only the manifest is purged. To roll back, point the manifest back to the old version; the old assets are still in the cache and in storage.

### Internal builds downloadable within seconds

When CI uploads build artifacts with a single PutObject, testers add `no-wait=10` to the download link (include it in the signature for private files) and can start downloading during the upload. Large files uploaded with multipart upload can be downloaded only after the upload completes. See [Simul-Transfer](https://docs.bitiful.com/en/bitiful-s4/features/simul-transfer.md).

## Launch checklist

- [ ] Installer file names include the version number, and only the version manifest gets updated
- [ ] CI and the release system use different sub-users, and releases carry `If-None-Match: *`
- [ ] The download domain has HTTPS turned on with auto-renewing certificates
- [ ] Download links carry `response-content-disposition`, and per-connection speed limits, hotlink protection, and no caching for the manifest are configured
- [ ] Signature authentication is turned on for the beta directory
- [ ] Prefetch before release, and purge the manifest after release
- [ ] Someone watches Usage and Live logs on release day

## Related docs

- [Limits](https://docs.bitiful.com/en/bitiful-s4/limits.md)
- [Edge rules](https://docs.bitiful.com/en/cdn/handbook/rules.md)
- [Performance and response settings](https://docs.bitiful.com/en/cdn/handbook/performance.md)
- [Cache, purge, and prefetch](https://docs.bitiful.com/en/cdn/handbook/cache.md)
- [Conditional requests](https://docs.bitiful.com/en/developer/s3/conditional-requests.md)
