Cache what is sliding expiration




















Difference between Absolute Expiration and Sliding Expiration. Navigation 1 by 3 votes. Now, DateTime. AddSeconds 20 ; Response. Now, TimeSpan. FromSeconds 20 ; Response.

Include the following namespace in your application: Alachisoft. Client Alachisoft. Caching Alachisoft. Exceptions The application must be connected to cache before performing the operation. Cache must be running. Make sure that the data being added is serializable. To ensure the operation is fail safe, it is recommended to handle any potential exceptions within your application, as explained in Handling Failures.

To handle any unseen exceptions, refer to the Troubleshooting section. Add the following Maven dependencies in your pom.

Contains after expiration interval has elapsed Using cache. Below is a small example of Absolute expiration. Sliding expiration expires the cacheitem if it has not been accessed within the timespan provided.

This makes it easy to keep highly used items in cache. However be careful if you expect something to be refreshed at some point. Items that are used too often may never get expired - and therefore never refreshed.



0コメント

  • 1000 / 1000