S
S
Simona222017-05-02 11:45:26
css
Simona22, 2017-05-02 11:45:26

Cache for COM object in Web API?

I'm new to working with COM objects and can't figure out how to properly organize the cache.
The Web API has a Controller with a COM object that is initialized for each client. Each client can have different users. You need to create a cache so that the instance of the COM object is available for some time for users with the same client Id, for example, if user1 with clientId=1 made a request, then the COM object is stored in memory for a day for other users with clientId=1.
My difficulty with this is that when using a COM object, a reference count is created. If 2 clients made 2 requests, then there will be 2, 4 4, etc.? Or am I confusing something. Do I need a release com object per user? Each user has his own session, that is, when it expires, I ideally need to clear the cache and all of its reference, since this is a WebApi and nothing should be stored in memory for a long time.
Please advise something because in my head this problem does not have a good solution.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Proskurin, 2018-06-10
@StupidNick

Layout is doubly easier if it is on flexbox.
jsfiddle.net/85kpemg1

J
John_Nash, 2017-05-02
@John_Nash

static than does not suit?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question