Empty asp.net resource caching provided by SQLResourceProvider

I just implemented a provider SQLResourcein my MVC2 application. When I change something in the database manually or with a web form, I want to ResourceProviderdelete all resources and retrieve them from the database.

Is there anyone how can I clear this ResourceCacheone that is controlled by the ASP.NET native API?

+3
source share
1 answer

When implementing SQLResourceProvider, you must use caching with the database utility class. When creating a cache, you can define a policy that contains the ChangeMonitors property. I think adding the SqlCacheDepency element to the ChangeMonitors property is what you are looking for. Take a look at these SqlCacheDepency  , CacheItemPolicy classes . I can provide the code if you need it.

0
source

Source: https://habr.com/ru/post/1752784/


All Articles