Absolute cache expiry corrupts absolutely?
Should you specify absolute expiry of a cache item from the current time or from the current time in the UTC time zone? The answer may not be what you expect.
Should you specify absolute expiry of a cache item from the current time or from the current time in the UTC time zone? The answer may not be what you expect.
LazyCache is a library that makes it easy for developers to add in-memory caching to dotnet apps. Version 2 is a major rewrite to change from the .Net Framework 4.5 to Netstandard 2.0, and is now available from nuget.org/packages/LazyCache. Getting started Install from nuget: dotnet add package LazyCache --version 2.0.0 And then cache object that are slow or expensive to produce: IAppCache cache = new CachingService(); Func<ComplexObjects> complexObjectFactory = () => methodThatTakesTimeOrResources(); ComplexObjects cachedResults = cache....
The latests release of LazyCache, my open source cache library based on ObjectCache, makes it easy to cache the results of asynchronous or Task returning methods, so now it is simpler for you to speed up your application. Why bother with Async? Async code tends to be more efficient as you release threads while they are waiting for the response from an asynchronous resource, but at a cost of added code complexity....
tl;dr If you need to speed up your c# application you probably need to add caching, and the easiest way to do that is use the source library I wrote called LazyCache. Do I need to cache? Lots of apps don’t need caching because web servers and databases are fast. However many apps get to a point where performance becomes an issue, and adding caching is one easy way to get a significant performance boost....