← All posts
23 October 2026 · 6 min read

FiveM server resource and asset caching explained

The three caches between your FiveM server and your players, why the player's own cache is not enough, and how server-side resource and asset caching works.

When people talk about the FiveM cache, they usually mean the folder on a player's PC that you clear when textures go missing. That is only one of three caches involved in getting your resources to players. If you run a server, the other two matter more.

Resources and assets mean the same thing here: the maps, vehicles, clothing, scripts and UI files that players download when they join your server.

The three caches

  • The player's cache. FiveM keeps downloaded server files on the player's PC, in server-cache and server-cache-priv under %LocalAppData%\FiveM\FiveM.app\data. It saves that one player from downloading the same file twice.
  • The server's cache folder. FXServer keeps a cache folder in your server data folder. In it, it packs each resource's scripts and files into a resource.rpf and keeps a list of its streamed files. It rebuilds these on its own when you change a resource. We cover it in how to clear the FiveM server cache.
  • A server-side download cache. This is a CDN or caching proxy between your server and your players. It keeps a copy of every file your server sends, so the next player gets it from the cache instead of from your server.

Why the player's cache is not enough

The player's cache only helps that one player, and only for files they already have. Your server still sends every file to every new player. After an update, it sends the changed files again to everyone who joins. And after a restart, when a large part of your community connects within a few minutes, it does all of that at once while it is still starting up.

That is when joins get slow or fail. A player has about two minutes to get through the connection process. If the downloads take longer, the player lands back in the menu and tries again, which adds even more load.

What server-side resource caching changes

With a download cache in front of your server, each file leaves your server once. The first player who needs it pulls it through the cache, and every player after that gets the cached copy. Your server goes back to running the game. Download speed no longer depends on your server's upload or on how far the player is from it.

FiveM supports this out of the box. It takes two convars:

  • fileserver_add tells players to download resources from another URL instead of from your server. See how fileserver_add works.
  • adhesive_cdnKey makes the files the same for every player. Without it, FiveM prepares each file differently for each player, and a cache cannot reuse anything. See why a cache needs adhesive_cdnKey.

How updates reach players

Every file in the list your server sends to players comes with a hash of its contents. When you change a file, its hash changes and the client downloads the new version. The cache in between has to keep up with that, or players get an old file. FiveMCDN's own invalidation system takes care of it: changed files are fetched fresh, unchanged files keep coming from the cache, and there is nothing to purge after an update.

Scripts work a little differently from streamed assets. FXServer packs a resource's scripts and its files entries into one package, so a small script change means players download that whole package again. We explain that and how to keep it small in why players download your resources again.

Setting it up with FiveMCDN

FiveMCDN is a managed version of this. You add your server, copy two lines into your server.cfg and restart. Files are cached on Cloudflare's network and served from a location near each player. Changed files are picked up automatically, and files are only served to players who are connected to your server.

server.cfg
# fivemcdn.com: add these 2 lines to server.cfg, then restart your server
fileserver_add ".*" "https://cache.fivemcdn.com/t/ab12cd34/files"
set adhesive_cdnKey "k9f2Qv7pXn3wLtB8sZ1aRcYd"

The quickstart takes about five minutes. Thinking about running your own cache instead? Read what a self-hosted nginx cache involves.

Take downloads off your server

Two lines in server.cfg. Free plan, no card needed.

Start free
More from the blog