With Infinispan, you can give a specific lifespan to data, so you can get it to last for 5 minutes.
The typical code pattern is that you query the cache with a key, and if value not found, put the data for 5 minutes. Further requests will find the data and will not update the cache. Once the 5 minutes have expired, the cache query with the key will indicate no key is present and so you store again.
You can also configure maxIdle time after which data is expired from memory.