Invalidating the data store
In general, a cache dependency can be another item in the cache, a file on the file system, or data from a Microsoft SQL Server database.
Unfortunately, invalidating the cache is not straightforward because the method.Figure 1: The Caching Layer (CL) is Another Layer in Our Architecture In this tutorial we will create a very simple CL with a single class classes, and providing a method in these Caching Layer classes for each data access or modification method in the BLL.As with the BLL and DAL, the Caching Layer should ideally be implemented as a separate Class Library project; however, we will implement it as a class in the classes at your leisure.Figure 3: The Caching Layer s Methods Return Data from the Cache if it s Available The sequence depicted in Figure 3 is accomplished in the CL classes using the following pattern: contains a reference to the data, either from the cache or pulled from the BLL.
Be sure to use the above pattern when accessing data from the cache.
In the Along with data retrieval methods, the Caching Layer needs to provide the same methods as the BLL for inserting, updating, and deleting data.