Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
270 views

I need to store an access token value in memory because it only expires after 24 hours once I get it. So I used memory cache for this. I first inject IMemoryCache into my service and I added this ...
Franky's user avatar
  • 1,676
0 votes
1 answer
269 views

I have a ASP.NET application (.NET8) that receives 100 REST calls per minute, each transferring 1MB of data, which is serialized (JSON) and stored in MemoryCache (Microsoft.Extensions.Caching.Memory). ...
user25410615's user avatar
0 votes
1 answer
242 views

I understand items in MemoryCache are not disposed when expired. I am caching some X509Certificate2 which according to the documentation, should be disposed when done. However, my naive approach would ...
Luke Vo's user avatar
  • 21.6k
0 votes
0 answers
96 views

I am implementing in C# .NET a simple message consumer that reads off a queue a bunch of key, value pair messages and I need to maintain a dictionary of key -> [values seen so far] (this is ...
fricadelle's user avatar
1 vote
2 answers
44 views

I have my Blazor server app set up where I cache the AppUser object for the logged in user. It's a pretty heavy read from the DB with 11 queries (using SplitQueries). But once I have it, it then gives ...
David Thielen's user avatar
0 votes
1 answer
69 views

I'm running into this error: InvalidOperationException: A second operation was started on this context instance before a previous operation completed. This is usually caused by different threads ...
tvbRPTI2754's user avatar
3 votes
0 answers
138 views

I would like to start caching some of the data in web API But I am getting some errors. I am using the HttpContent and storing it in cache using the CacheHelper.SaveTocache. On the next connection I ...
Jefferson's user avatar
  • 121
0 votes
1 answer
760 views

I have an IHostedService that saves a reference table from the database to cache in .NET Core 6. Meaning, the information saved will not be changed; it's just a reference table. Though there were ...
choopau's user avatar
  • 2,449
0 votes
0 answers
104 views

I have encountered a strange thing. I have a web api project of .net 6. When IServiceProvider starts, it will use FileService to read data and store it in the cache, and set IChangeToken. If the ...
Ching Wang's user avatar
2 votes
1 answer
697 views

i want to have a big concurrencies with the cloud function, so I'm using the cloud function v2. But, in one of the steps, I want only 1 process can do it, while other processes need to wait for it. ...
Mark's user avatar
  • 2,043
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 ...
JuanDYB's user avatar
  • 808
0 votes
1 answer
1k views

I am attempting to put a wrapper around a repository call, so that the items can be cached. Here is a cut down overview: I have an interface for listing categories: public interface ...
user978426's user avatar
1 vote
1 answer
690 views

Despite Unity container being deprecated, unfortunately I find myself having to use it since the current wpf codebase I'm working on has been dependent on it for years. On the server side, I'm able to ...
user3613025's user avatar
2 votes
1 answer
383 views

I'm trying to connect Apache Ignite with Nest JS. I'm getting error regarding the library I used: 'apache-ignite-client'. Error: TypeError: apache_ignite_client_1.default is not a constructor. Code ...
Ajay Kakde's user avatar
18 votes
2 answers
7k views

The extension method GetOrCreateAsync for IMemoryCache: public static async Task<TItem?> GetOrCreateAsync<TItem>(this IMemoryCache cache, object key, Func<ICacheEntry, Task<TItem>&...
Luke Vo's user avatar
  • 21.6k
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 ...
Mosh's user avatar
  • 1
1 vote
0 answers
465 views

According to this doc, Microsoft.Extensions.Caching.Memory is recommended over System.Runtime.Caching/MemoryCache. System.Runtime.Caching/MemoryCache is thread safe as metioned here. But is Microsoft....
Wuloo's user avatar
  • 15
0 votes
0 answers
64 views

I use MemoryCache with ASP .Net Core. I want to save List<> in cache, but got strange problem. Forming List; Succesfully saved it in cache: TrySetEntity(typeof(SkvBase).Name, _wells, ...
Roman's user avatar
  • 161
0 votes
1 answer
3k views

I'm trying to find the best way to store complex objects in a MemoryCache (specifically Microsoft.Extensions.Caching.Memory.MemoryCache). My data's structure would be something as below: public class ...
carlosmachina's user avatar
0 votes
0 answers
1k views

I have a lot of NullReferenceException exceptions on the line if (foosDictionary.TryGetValue(id, out var foo)) and I cannot in any way reproduce the issue. Stack trace: System.NullReferenceException: ...
Nikita Kalimov's user avatar
0 votes
1 answer
1k views

I have a site where you can list your car for sale. There is a list and a map with filtering on car types and other car specifications. My idea was to cache cars table and use that to filter on when ...
Mil's user avatar
  • 53
0 votes
2 answers
2k views

I have a method that will expire null items immediately, however I wanted to know if there w as better way to do this for all memory cache items instead of repeating the same code over and over output ...
CodeMan03's user avatar
  • 247
0 votes
1 answer
1k views

I use the MemoryCache library in an ASP.NET Core project to create a cache, following the Microsoft documentation (https://learn.microsoft.com/en-us/aspnet/core/performance/caching/memory?view=...
Lorenzo Lanzarone's user avatar
0 votes
0 answers
668 views

I am trying to add items to MemoryCache, when adding each item is accompanied by CacheItemPolicy with SlidingExpiration set to 3 seconds. According to the documentation for SlidingExpiration: A span ...
Yamamotooko's user avatar
1 vote
1 answer
668 views

how can i add memorycache in this method ? this is a section of my code that i want to set memory cache on it. public IActionResult Index(int pageId = 1, string filter = "", int ...
Hamed Kermani's user avatar

1
2 3 4 5
8