Server Side Caching for Java / Java EE Application

Here is my situation: I have a single page Java EE application. All JSON-based AJAX client-server communication is used as a format for exchanging data. One of my queries takes about 1 minute to calculate the data the client needs. This data is also huge (maybe> 20 MB). Thus, it is not possible to pass whole data to javascript at a time. Therefore, for this reason, I transfer only a few records to the client and use the grid to display data with the swap option.

Now, when the user clicks the button on the next page, I need to get more data. My question is: how do I cache data on the server side? I need this data for only one user as time. Would you recommend to cache all data with a single first request using a session id as a key?

Any other suggestions?

+3
source share
2 answers

The cheapest (and not so inefficient way to cache data) in a Java EE web application is to use a Session object, as you intend to do. It is inefficient because the developer needs to ensure that the cache does not leak memory; therefore, the developer must abandon the reference to the object when the object is no longer needed.

, , 20 , . , , 20 - .

" " JSON ValueList. , . , , . , ; , .

+1

, . , . , JS (, ExtJS).

( ), : , db, , .

, .

+1

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


All Articles