How can I cache all view user requests so If the same request is made again it is fetched from cache

StackOverflow https://stackoverflow.com/questions/12429628

سؤال

I have rather big application with lots of documents and lots of different view controls.

To speed up things and avoid unnecessary view and view search requests I would like to cache the already requested documents or view entries so if users do the same request again the repeats first looks in the cache.

I am thinking about writing a generic function that stores all requested unids in a sessionScope that I can apply to all view collection as my application retrieves values from documents and not view column values.

I guess this kind function need to keep track of which request was made and switch back to non cache content if more rows are needed by the user.

هل كانت مفيدة؟

المحلول

You need to develop a Bean (Java Class) and bind your controls to the Bean instead of directly to View and Document datasources. Inside the bean you can maintain a cache of the views/documents already loaded.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top