Ability to use external download source for plugins cache / cars and other models

fastdl
cdn

#1

Ability to specify download location for resources cache, and especially vehicle models and map mods could come in handy to use external server or even a globally distributed CDN and:

  • Reduce download latency by delivering assets as close as geographically possible to visitors, and thus make loading times dramaticaly lower (servers with custom maps and cars would benefit from this greatly)
  • Allow server owners to use the latest web technologies for delivering, such as http/2.0, gzip / brotli compression, etc.
  • Cut server costs and leave more bandwidth for transferring other user data and such things as mumble (some users claimed that built-in mumble server becomes unstable during other players connecting)
  • Generaly give more flexibility for server owners, make servers faster and safer

How this could be implemented:

  • Adding server command line or cfg parameter to launch server in “preparation” mode and generate a folder that needs to be uploaded to the external download source
  • Adding server cfg parameter for the external download link
  • Checking server side during launch (or client side during joining) if hashes of files that are hosted externaly match hashes of files provided by server, and fallback to downloading from the default fivem http server if external files are outdated.

Similiar technology is used in dozens of games made by Valve (called fastdl).


#2

Agreed that’s a great idea; For all of your reasoning as well!


#3

There’s already plans existing for an external ‘smart’ proxy server for use with ‘normal’ caching HTTP frontends (including CloudFlare’s free offering), which as opposed to the suggestion above would have practically no issues with maintaining an on-disk layout matching the virtual layout and would still be able to benefit from resource obfuscation.

In addition, resource configuration is still planned to be refactored to not hang the libuv thread as much; this mainly has to do with inefficient JSON libraries.


#4

it should also be noted that the old server code (though not really relevant anymore) had support for automatically FTP/FTPS’ing a file tree to a remote endpoint, but with resource obfuscation existing this wouldn’t be really helpful probably.