Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
65 views

My api depends on some programs that are expensive to start up for each call. I am trying to inject a cache that contains the cached objects wrapping the programs so they can be reused without killing ...
2 votes
0 answers
117 views

I have MemoryCacheService class in .NET 8. Then I want to get expiration time of the setted cache key. I set the value to cache with below method. public bool Set<T>(string key, T value, ...
0 votes
0 answers
74 views

I have a CMS Application in .net 6 mvc, I've published that app on IIS server local. I've implemented cache system using MemoryCache. I have written code to expire all cache when I publish a Content ...
0 votes
0 answers
773 views

I'm using Microsoft.Extensions.Caching.Memory, as I hav read it is the newer implementation of System.Runtime.Caching. I have been reading that it's not recommended to have more than one instances of ...
0 votes
0 answers
36 views

I have a singleton ActionFilter and I want to store data in cache. What I did: Program.cs builder.Services.AddSingleton<MyActionFilter>(); builder.Services.AddMemoryCache(); ActionFilter public ...
0 votes
0 answers
259 views

I've trying to build a web API throttling mechanism in ASP.NET Core that "penalizes" excess usage in an exponentially-growing denial window e.g. first 3 tries are allowed, 4th is blocked if ...
0 votes
0 answers
398 views

I'm working on some solution where I need first value of the in-memory cache and I don't know the key of the first value. How can I get the key of item at beginning of the in-memory cache? I'm using ...
0 votes
0 answers
78 views

I have an interface that is used to implement a class that fetches data from Memory Cache: public interface ICacheReader { IEnumerable<Employee> GetEmployees(); Employee GetEmployeeById(...
3 votes
0 answers
1k views

I had an issue with memory leaks. After some investigation, I finally found a source. I managed to fix the issue, but I don't really understand why it works. It seems like some garbage collector thing,...
1 vote
0 answers
170 views

Our old .Net framework APIs utilized the Strathweb.CacheOutput.WebApi2 which took care of server-side caching and set the appropriate client side headers in order to implement a form of output caching....
3 votes
0 answers
661 views

I am troubleshooting a high traffic C# .NET Framework 4.61 website that utilizes System.Runtime.Caching.MemoryCache quite extensively. In the most recent week, I've seen slowdowns and when I put up ...
2 votes
0 answers
341 views

I have an asp.net web api that holds objects using MemoryCache. The cache is for one week. var cacheEntry = _cache.GetOrCreate(CacheKeys.Entry, entry => { entry.SlidingExpiration = ...
0 votes
0 answers
293 views

I'm trying to fully understand the implications of thread safety in maintaining a BlockingCollection inside a MemoryCache The scenario: log recent users that request any page from a site. Use an ...
1 vote
0 answers
629 views

We have a problem in our batch processing application. It is a console application written in C# that is running in a loop at takes tasks from database. It (almost) never quits - just for deployments. ...
0 votes
0 answers
76 views

This is easier to explain if I first explain my order of events: User requests a webpage that requires x database objects The server checks the cache to see if it is cached, and if it is not, it re-...
1 vote
0 answers
860 views

I am using MemoryCache in one of my project to cache some keys and value. I have attached a listener on my MemoryCache that whenever it is expiring any items then that listener should get called so ...
0 votes
0 answers
637 views

TLDR; I want to remove from cache all entries having their keys starting with "foo". Hi! I am storing some data in MemoryCache like this: MemoryCache.Default.Add("foo" + searchHash,...
1 vote
0 answers
420 views

Is it possible to distribute memory cache across nodes in Service Fabric? I'm currently using memory cache to store a logged in users authentication ticket, but when I deploy to an environment with ...
3 votes
0 answers
6k views

Right now, I am using MemoryCache from System.Runtime.Caching. Recently, I came to know that Asp.net Core framework supports MemoryCache from Microsoft.Extensions.Caching.Memory. As I am using that ...
2 votes
0 answers
2k views

I need to store and update List in MemoryCache. Every transaction hitting my WEB.API will add a record to this List, and every 1 min the list will be dumped into database and removed from cache. My ...
0 votes
0 answers
310 views

I am facing an issue with memory cache cleaning up. I haven't set any maximum age in the cache header. Please find the IIS HTTP response header settings below Below is the Httpservice code from the ...
0 votes
0 answers
219 views

Say I have a C# MVC5 Website with multiple MemoryCaches for various different objects, each with a refresh time of about 2 hours. Say I want to have a progress load bar so that when someone hits the ...
4 votes
0 answers
171 views

We have an application that heavily utilizes the MemoryCache class provided by .NET, and up until recently, everything has been working well on our servers, but now we've started to notice CPU spikes ...
3 votes
0 answers
594 views

I've been working with System.Runtime.Caching.MemoryCache and I'm having some trouble regarding Monitors dispose. So a little bit of context, I'm trying to implement a cache where items get ...
0 votes
0 answers
587 views

There are two ASP.NET MVC app on one pool with a two different AppDomain How can I clear the MemoryCache on all AppDomain's in pool? MemoryCache.Default.Remove(key) This code clear cache only in one ...