> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sacul.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# FiveM Cache Setup

> Register a FiveM server and install the sCloud cache config

# FiveM Cache setup

sCloud FiveM Cache helps your players download FiveM resources through an edge cache instead of pulling every file directly from your game server.

The dashboard does most of the setup for you. You only need your public Cfx.re server ID, then you copy two generated lines into `server.cfg`.

<Note>
  FiveM Cache is a paid subscription product. There is no free forever plan, but the Solo plan includes a 7-day trial.
</Note>

## Before you start

You need:

* An active FiveM Cache subscription or trial
* A FiveM server listed on Cfx.re
* Access to edit your server's `server.cfg`
* A public connection endpoint on your Cfx.re listing

You do not need to manually type your server IP in most cases. sCloud looks up your Cfx server and detects the public endpoint automatically.

## Find your Cfx server ID

Your Cfx server ID is the short code used by Cfx.re for your server.

Examples:

* `daxy53`
* `abc123`

You can usually find it in your Cfx.re server listing URL or direct connect code.

## Register your server

1. Open the [FiveM Cache dashboard](https://sacul.cloud/dashboard/services/fivem-cache).
2. Click **Add server**.
3. Enter your Cfx server ID.
4. Click **Find server**.
5. Review the server name, owner, players, tags, and detected endpoint.
6. Keep the generated sCloud server slug or edit it if needed.
7. Click **Register this server**.

After registration, the dashboard shows your generated setup config.

<Warning>
  The `adhesive_cdnKey` is shown only once. Store it somewhere safe before leaving the setup screen.
</Warning>

## Add the generated config

Copy the generated block from the dashboard into your `server.cfg`:

```cfg theme={null}
fileserver_add ".*" "https://fivem-cache.sacul.cloud/YOUR_SERVER_SLUG/files"
adhesive_cdnKey "GENERATED_SECRET"
```

Replace values only if you are copying the example manually. The dashboard already fills in your real server slug and generated secret.

Then:

1. Save `server.cfg`.
2. Restart your FiveM server.
3. Join the server once to start warming the cache.
4. Open the dashboard analytics after the first requests.

## How cache purging works

When you purge a FiveM Cache server, sCloud invalidates old cached files by moving the server to a new cache version.

This means the next player requests fetch fresh resources from your FiveM server, while old cached objects can expire naturally in storage.

## Analytics

The dashboard shows:

* Requests per registered server
* Cache HIT, MISS, and origin error counts
* Bandwidth served through the cache
* Estimated origin bandwidth saved
* Average response time
* Top file extensions
* Origin response statuses

Analytics retention depends on your plan:

| Plan      | Analytics retention |
| --------- | ------------------- |
| Solo      | 14 days             |
| Community | 30 days             |
| Network   | 90 days             |

## Plan features

| Plan      | Servers | Features                                                             |
| --------- | ------: | -------------------------------------------------------------------- |
| Solo      |       1 | Instant purge, 14-day analytics                                      |
| Community |       3 | Instant purge, cache preload, 30-day analytics                       |
| Network   |      10 | Cache preload, scheduled refresh, priority support, 90-day analytics |

<Note>
  Cache preload and scheduled refresh may appear as unavailable until the backend support is enabled for your plan.
</Note>

## Troubleshooting

### sCloud cannot detect a public endpoint

If setup says no public connection endpoint was detected, check your FiveM server listing and configuration.

sCloud reads the public `connectEndPoints` value from Cfx.re. If Cfx.re does not expose it, the dashboard cannot safely register the server automatically.

### Players still download from the origin

Check that both lines are present in `server.cfg`:

```cfg theme={null}
fileserver_add ".*" "https://fivem-cache.sacul.cloud/YOUR_SERVER_SLUG/files"
adhesive_cdnKey "GENERATED_SECRET"
```

Then restart the FiveM server. Reloading resources without a full restart may not apply the fileserver config.

### Players are stuck while connecting

If players get stuck during server connection, open the FiveM console with **F8** on the player client. FiveM usually prints the download or fileserver error there.

Common causes:

* The public endpoint detected from Cfx.re changed after registration.
* A firewall, DDoS protection, reverse proxy, or Cloudflare rule is blocking sCloud cache requests to your origin endpoint.
* The Cfx server key was rotated in the Cfx.re portal, which can change the server ID used for registration.

Start by checking the origin endpoint shown in the sCloud dashboard:

1. Open your FiveM Cache server in the dashboard.
2. Click **Refresh Cfx metadata**.
3. If Cfx reports a different endpoint, review it and update the origin if it is correct.
4. Try connecting again and check the FiveM F8 console for the latest error.

If your origin uses firewall rules or extra protection, allow requests from the sCloud cache service to reach your FiveM resource endpoint. The cache must be able to fetch files from your server before players can download them through sCloud.

<Warning>
  If you rotated your Cfx server key in the Cfx.re portal and the server now has a new Cfx server ID, delete the old server from the sCloud dashboard and register it again with the new Cfx server ID.
</Warning>

### I rotated the adhesive key

After rotating the key in the dashboard, copy the new `adhesive_cdnKey` into `server.cfg` and restart the server.

The old key stops being valid after rotation.
