Using shared cache
The sample Football Trading application needs to cover a new scenario. Some football players can play in different positions, sometimes as defenders and sometimes as midfielders. Players do not change their position frequently, but it may happen. As we learned in the previous recipe, caching the players can improve the application’s performance significantly. We assume it’s possible and recommended to have more than one application instance running simultaneously. When a player is updated, all the application instances should return the latest version of the player.
In this recipe, we’ll learn how to use an external cache shared among all application instances and how to update the cache when the underlying data is modified.
Getting ready
In this recipe, we’ll reuse the application resulting from the previous recipe, as it has already been configured for caching. I have prepared a working version in the GitHub repository at https...