Honestly, it was a huge pain in the ass, as I said - all edge cases, and undocumented limitations, some of them device specific (like the file name length). We used cordova-plugin-httpd for the server, and we just randomly select a port (well, we have a preferred port, then we randomly choose if it isn’t available). Using the package to setup the server is trivial (apart from the port number conflict) - more tricky is generating the URLs, handling storage limits, toggling between offline and online content, these will all likely be specific to your use cases (e.g., when running out of space, do you delete “expired” content, or just fail silently, or warn the user?)