FiveMesh

Sacul

FiveM Cache HIT vs MISS: How Resource Caching Actually Works

Learn what FiveM cache HITs and MISSes mean, why a MISS after an update is normal, and how to read FiveMesh Cache analytics.

FiveM Cache HIT vs MISS: How Resource Caching Actually Works

It is easy to open cache analytics, see a row of MISS requests, and assume the cache is broken.

Usually, it is not. A cache is supposed to MISS sometimes. A MISS is how it gets a fresh file from your FXServer origin before it can reuse that file for later requests. The useful question is not "do I have any MISSes?" It is whether the cache is behaving as expected for the resources, updates and player traffic your server actually has.

This guide explains what HIT and MISS mean for FiveM resource downloads, why a new resource version can create a MISS, how hashes and cache versions prevent stale resources from being served, and how to interpret FiveMesh Cache analytics without chasing the wrong metric.

The short version

HIT  = the requested resource was already available in cache.
MISS = the cache fetched the requested resource from your FXServer origin, then stored it.

On a HIT, the player receives the cached copy and your FXServer does not need to serve that resource again for that request.

On a MISS, the cache asks the origin for the current file, returns it to the player, and keeps a copy for later matching requests. That first request still works; it simply uses the origin once.

First request for a resource
Player -> FiveMesh Cache -> FXServer origin -> Player

Later matching request
Player -> FiveMesh Cache -> Player

Both outcomes are normal. The cache only becomes useful when the same valid resource is requested again.

What is a cache HIT?

A cache HIT means FiveMesh already has the exact resource version the player requested. It can return that file from the cache without fetching it from the FiveM server first.

For a server with recurring player joins, HITs are where the operational benefit appears. The same clothing pack, map, vehicle stream, UI file or script asset can be delivered repeatedly without making FXServer send the full file for every player.

A HIT does not mean the resource was made smaller. The player still downloads the file they need. It means the file was served from the cache instead of from your origin.

What is a cache MISS?

A cache MISS means FiveMesh does not yet have a cached copy for that specific request. It fetches the file from your configured origin, returns it to the player, and stores it under the matching cache key.

A MISS is expected when:

  • Cache is newly enabled for a server.
  • A resource is requested for the first time.
  • A resource has just changed.
  • You have purged the cache.
  • The request includes a new resource hash or cache version.

A MISS is not an error. An origin error is different: it means the cache asked your origin for a file and the origin could not return a successful response. In the dashboard, keep errors separate from normal MISS traffic.

Why an updated resource can cause a MISS

After you update a resource, players should receive the updated version, not the old copy that happened to be cached earlier.

FiveM emits a new ?hash=... value when a resource changes. That changes the cache identity, so the old cached file is not a match for the new request. The first request for that new hash can therefore be a MISS. FiveMesh retrieves the current file from the origin and automatically stores it; later players requesting the same version can receive a HIT.

This is a healthy lifecycle:

Resource update
    -> first matching request is a MISS
    -> cache stores the current file
    -> later matching requests become HITs

Do not judge a cache from the five minutes after a deploy, restart or large resource update. Look at the traffic pattern across a useful period, after requests for the new hashes have had time to warm the cache.

How hashes prevent old resources from being served

File paths alone are not enough to identify a FiveM resource safely. A file can keep the same name while its contents change.

FiveMesh includes the server, cache version, request hash when FiveM provides one, and file path in the cache identity. When FiveM requests a new hashed version of a resource, it is a different cache entry from the earlier version. A cached copy for the old hash cannot satisfy the request for the new hash.

This is why a MISS after a resource change is useful. It is the cache learning the version that players should receive now, rather than guessing that a same-named old file is still valid.

The hash is not compression and it does not reduce download size. It is a version identity: it helps make sure the cache only reuses the exact content requested.

Why purge is almost never needed

Purge is a recovery tool, not a normal deployment step.

When you change a resource on FXServer, FiveM emits a new ?hash=... value for clients. Because that hash is part of the cache identity, the cached copy for the previous version cannot be returned for the new request. In normal operation, that already gives players the latest resource without a purge.

When you purge FiveMesh Cache, the server cache version advances. New requests then use a new version namespace and must populate it again, even if the resource itself has not changed. Repeated purges create unnecessary MISSes, send more traffic back to your origin, and reduce the benefit of the cache during busy joins.

Reserve purge for the unlikely case where you suspect corrupted cache state or another condition outside the normal FiveM hash flow. Let hashes handle ordinary resource releases and let unchanged resources remain cacheable between them.

Purge, automatic preload and scheduled refresh

These terms are often grouped together, but only two describe current FiveMesh Cache behaviour.

OperationWhat it doesBest use
PurgeCreates a new cache version, so existing entries are no longer used for future requests.Recovery when cache state is suspected to be corrupted or otherwise outside normal control.
Automatic preloadA MISS fetches the valid resource from the origin and automatically saves it for later matching requests.Normal cache warming as player traffic requests a new resource version.
Scheduled refreshWould proactively refresh a known list of resources on a timetable.Not implemented: current FiveM endpoints do not provide a reliable resource enumeration and refresh workflow.

Purge makes existing entries ineligible. Automatic preload warms a new version after it is first requested. Scheduled refresh is not an active FiveMesh Cache control, because FiveM's current endpoints do not expose the reliable resource list and refresh mechanism it would require.

None of these replaces resource versioning. Hashes and cache versions decide whether a cached file can match a request. The normal path is simple: a changed resource receives a new hash, then the cache automatically warms the matching new entry when it is requested.

How to interpret the HIT ratio

The HIT ratio is the share of requests that were served from cache during the selected time range:

HIT ratio = HIT requests / total requests

A high ratio usually means repeat requests are being absorbed by the cache and less download traffic is reaching your FXServer. It is a useful signal, but it is not a score to optimize in isolation.

There is no universal "good" number. A stable server with many returning joins and few resource changes can naturally reach a high ratio. A server that just launched Cache, regularly deploys packs, runs a large event, or receives many requests for previously unseen resources will see more MISSes. That can be perfectly healthy.

Compare equivalent periods instead of comparing a quiet weekday with the minutes after a deployment. Then read the ratio with the rest of the picture:

  • Requests: Is Cache receiving the expected player download traffic?
  • HIT and MISS ratio: Are repeat requests becoming HITs after the initial warm-up?
  • Bandwidth served: How much resource traffic did Cache deliver to players?
  • Origin bandwidth saved: How much repeated delivery was kept away from FXServer?
  • Average latency: Is the response time consistent for the selected period?
  • Origin errors: Did the origin fail when Cache needed a fresh file?

For example, a temporary drop in HIT ratio immediately after a large update is expected. A low ratio that stays low for days, combined with high origin bandwidth and no recent resource changes, is a reason to inspect the cache URL, update workflow and request pattern.

What the FiveMesh Cache dashboard is measuring

FiveMesh records the cache status for each request, the bytes served to the player, the bytes fetched from the origin when applicable, and the request duration. The dashboard turns those request records into the summary and timeline you use to operate the service.

That makes it possible to answer practical questions:

  • Did this update create a short, expected wave of MISSes?
  • Did the next player traffic warm the cache as expected?
  • How much download bandwidth was served by Cache?
  • Is FXServer still carrying too much repeated delivery?
  • Are players seeing normal MISSes, or is the origin returning errors?

Use the status filter when investigating a specific period. Filter to MISS when checking a deployment warm-up. Filter to HIT when confirming that later traffic is reusing cached resources. Check origin status and errors separately when the problem is that a file cannot be fetched at all.

A practical workflow after updating resources

For a normal resource deployment, keep the process simple:

  1. Deploy and verify the updated resources on your origin.
  2. Let FiveM issue the new hashed resource requests to clients.
  3. Expect the first request for a new hash to create a MISS and automatically warm that cache entry.
  4. Watch the following traffic period for HITs, served bandwidth, saved origin bandwidth and origin errors.
  5. Only consider purge if cache behaviour suggests corruption or another problem outside the normal hash lifecycle.

Do not expect a cache to eliminate every origin request. Expect it to stop unchanged, repeatedly requested resources from being downloaded from the same FXServer over and over.

A cache reduces repeated origin delivery, not resource size

This distinction matters when players still report slow first-time joins.

FiveMesh Cache can reduce the amount of repeated download traffic FXServer must deliver. It cannot make a 4 GB resource package become a 400 MB package. Every player who needs a resource still has to download the bytes required for that version.

If resource downloads are slow even when the cache is producing HITs, inspect the resource package itself as well: oversized textures, duplicate files, unnecessary maps, large vehicle packs and media that should live on a public CDN are all separate problems.

The strongest result usually combines both sides:

Smaller, cleaner resource packages
+ cache for repeated delivery
= less origin pressure and more predictable player downloads

Using FiveMesh Cache

FiveMesh Cache is built for the FiveM connection download path. It fetches from your configured resource origin on a MISS, reuses valid cached copies on later requests, and gives your team visibility into HITs, MISSes, served bandwidth, avoided origin bandwidth, latency and origin errors.

When you are ready to configure a server, follow the FiveMesh Cache setup guide. For cache version, purge, origin and analytics operations, use the Cache operations guide.

Final thought

MISS does not mean Cache failed. It usually means Cache is doing the work required to obtain a fresh resource once.

The goal is not to remove every MISS. The goal is to let hashes make ordinary updates safe, automatically warm the new resource version as it is requested, and keep repeated delivery away from FXServer. Purge is there for the exceptional recovery case, not every release.