Building on nhibernate second level cache and pushing objects into asp.net session

I have some large objects that are often accessed in the same session. For example, in my application there is a reporting page consisting of dynamically created diagram images. For each chart image on this page, the client makes requests to the corresponding controller, and the controller generates images using some objects. I can use the asp.net session dictionary to "cache" these objects or rely on support for second-level caching nhibernate using, for example, cached requests.

What is your opinion?

By the way, will I use shared hosting that supports a friendly second-level cache?

Thank.

+3
source share
2 answers

I think you should use NHibernate cache. If the user makes a separate request to receive each object one by one, then you probably should use different ISIBNAME implementations to receive them (for example, because of a session on a web request strategy).

Also, when using the Nhibernate cache, you will not have problems with concurrency problems - it will handle them for you.

+2
source

Keep in mind the caching of the entity (from the session with which you downloaded it) in a static variable, which is then accessed by another session (for example, pulled from the caching system you created).

Entity , .

, ( NH Session) .

, .

0

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


All Articles