Will it stay in cache forever?
This will depend on the particular cache provider you are using. For example, if you use the default cache, it may expire if the server starts to run out of memory or if the application pool is being processed. But if you use another cache provider, for example, for example, a distributed cache, for example memcached or AppFactory , this will depend on the particular implementation.
The rule of thumb is to never assume that something is inside the cache because you previously saved it. Always check for an item in the cache first, and if not, remove it and store it in the cache again.
source share