Closed PostAlmostAnything closed 4 years ago
The application currently uses .Net Framework 4.7.2
Looks like I can add LazyCache to the .cs files associated with the .asmx files after they pull lists of data from the .xsd fileds. It works much faster, but I would like to know how often the cache is reset. One of the web services is a list of search suggestions for an autocomplete extender from the AJAX Control Toolkit which gets its suggestions from tags in individual posts and I don' want them to get too outdated.
LazyCache 2 targets netstandard2 so will work fine in current versions of full framework. If using earlier. Net Framework versions you will need to use LazyCache 0.7. The readme had exact details of compatibility between versions.
The sample app in this repo targets full framework, but uses MVC rather than web forms.
To use it in webforms just instantiate a ‘new CachingService()‘ in code-behind and you will get a reference to the default shared cache, or you can use a dependency injection service and obtain a reference to IAppCache.
The defaults are to cache for 20m and then expire. This default can be changed, or you can change how long to cache each item specifically using the API as you insert the item. The wiki in this repo had lots of docs showing how.
Let me know if you have any other questions, and please close this issue once you have solved your problem.
Am closing for now, but can reopen later if required. Thanks,
I just installed LazyCache via Nuget Package Manager in Visual Studio for an old ASP.Net Web Forms application, but cannot find any examples of how to use LazyCache beyond installing it. All of the examples you use involve EF and most of them are on .Net Core applications. Yet you claim to support .Net Framework applications.
How do I add LazyCache support for my existing Web Services(.asmx), Table Adapters(.xsd), and SqlDataSource controls? This old design does not use Entity Framework or MVC.