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.

July 12, 2019 · 5 min · 874 words · Alastair Crabtree

LazyCache 2.0 released

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....

March 22, 2019 · 2 min · 414 words · Alastair Crabtree

Cache the result of an async method using LazyCache

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....

September 30, 2016 · 3 min · 626 words · Alastair Crabtree

LazyCache: The easy way to add caching to your .net app & make it fast

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....

May 23, 2016 · 7 min · 1282 words · Alastair Crabtree