Created on 25 April 2022
icon_unfollowing
Login to follow
lazycache

LazyCache

Stable version 1.0.1 (Compatible with OutSystems 11)
Uploaded on 30 April 2022 by 
lazycache

LazyCache

Documentation
1.0.0

Lazy cache is a simple in-memory caching service. It has a developer friendly generics based API, and provides a thread safe cache implementation that guarantees to only execute your cachable delegates once (it's lazy!). Under the hood it leverages Microsoft.Extensions.Caching and Lazy to provide performance and reliability in heavy load scenarios.



What should I use it for?

LazyCache suits the caching of database calls, complex object graph building routines and web service calls that should be cached for performance. Allows items to be cached for long or short periods, but defaults to 20 mins.


Features

  • Simple API with familiar sliding or absolute expiration
  • Guaranteed single evaluation of your factory delegate whose results you want to cache
  • Strongly typed generics based API. No need to cast your cached objects every time you retrieve them
  • Stops you inadvertently caching an exception by removing Lazys that evaluate to an exception
  • Thread safe, concurrency ready
  • Async compatible - lazy single evaluation of async delegates using GetOrAddAsync()
  • Interface based API and built in MockCache to support test driven development and dependency injection
  • Leverages a provider model on top of IMemoryCache under the hood and can be extended with your own implementation
  • Good test coverage

Support options
This asset is not supported by OutSystems. You may use the discussion forums to leave suggestions or obtain best-effort support from the community, including from  who created this asset.
Dependencies
LazyCache has no dependencies.