Going further with caching
Well, as we saw, images are not the only type of data we can download through the internet using the HTTPRequest
node; for instance, we also downloaded the PlayersSpaceship.json
file, which is a text file. But we can download pretty much anything using this protocol, provided it is stored in an HTTP page. But sometimes, some files are not stored and made available publicly on an HTTP page that any browser can access. Usually in this type of situation, the backend engineer will create a REST API that we can use to retrieve these files directly from the database where they are stored.
This type of feature demands a physical infrastructure and the development of a custom REST API so we can work with it. Unfortunately, this goes way beyond the scope of this book. But the whole idea is that you can perform an HTTP request using custom headers and a custom URL that resembles an RPC. So, in the very URL itself you would add some parameters that the REST API would...