Setting Up a FiveM Cache Server
To optimize your FiveM server's performance, you can use the Cache Server feature to serve assets through a global CDN. This helps reduce player load times and lowers overall server bandwidth usage.
Step 1: Access the Cache Server Menu
Log in to the Layer Portal.
On the left-hand sidebar, click the FiveM dropdown menu.
Select Cache Server from the options.
Step 2: Choose Your Server
On the Cache Server page, locate the Select Your Server section.
Search for your server by name or product ID.
Click the blue Configure Cache button next to your active server (e.g., Descriptive Weird).
Step 3: Configure Cache Settings
FiveM Port: Enter the port your FiveM server is currently running on (Default is 30120).
Clear Cache (Optional): Check this box if you want to force all clients to re-download assets by adding a random suffix to the URLs.
Review the Cache Server Benefits, which include improved server performance and global CDN distribution.
Click the blue Generate Cache Server button.
Step 4: Apply the Configuration
Once the configuration is generated, you will see two lines of code:
set adhesive_cdnKey "YourUniqueKey"fileserver_add ".*" "YourCDNLink"
Click the Copy icon to copy these lines.
Open your FiveM server's
server.cfgfile.Paste the lines into the file, save it, and restart your FiveM server to apply the changes.
Test your server to ensure assets are now loading from the cache server.

