I have encountered many Apps that has a server-side handler with the following features:
(1) The App makes "pictures, musics" that needs to be downloaded going through a CDN caching network and therefore the URL to access for example a.jpg
will be https://myapp.com/assets/a.jpg?version=1
and the last version=1
is to get around CDN caching when an update to the file is issued.
(2) On the other hand, API requests like https://myapp.com/api/register
will not go through CDN caching and each time a fresh copy of response is returned without the need for the URL to be different.
I am wondering how are the above two cases differentiated. If I were to develop a similar server-side handler, would I need to set it up manually? Or is it done based on some automatic rules like is it a GET or a POST?
Also, is it possible to make some specific API requests go through CDN caching? For instance, I might have a https://myapp.com/api/getBigData
API that needs to retrieve data from an internal database and return to the user, but the data itself will never change. In this case I would like to have my specific getBigData
API to go through CDN caching but not other APIs like registering new users.
I's safe to assume I am talking about generally popular cloud platforms like Google or Amazon here and not some obscure cloud service with non-common features.
If different platforms deal with it differently I would like some sharing of some popular platforms so that I can have a general understanding. (I have tried to look it up myself in the Google CDN documentation but couldn't find anything)