Caching Data to Decrease Bandwidth
When it comes to reducing bandwidth usage and optimizing network usage in game development, there is a powerful technique that always comes to mind: caching.
Caching solves the question of why we should keep downloading the same data repeatedly when we can download it once, store it somewhere, and reuse it whenever needed. In this chapter, we will delve into caching techniques and learn how to apply them to efficiently download, store, and reuse images and other relevant data. For that, we will use a database that contains image URLs that we are going to download directly from the internet into our players’ machines.
To demonstrate the implementation of these caching techniques, we will prototype a new feature in our game project, where players will have the ability to upload custom images for their spaceships. To save time and focus solely on the network aspect of this feature, we will avoid implementing user experience and user interface...