开发者

Is there something like asynchronous caching with ehcache and springmodules?

Is it possible to have cached queries asynchronous, so that no frontend user actually has to wait for a heavy query to finish? (I.e. heavy query is running as background thread, while (expired) data is delivered from cache.

Use case: A web page displaying data, needing some time (too long to wait for when requesting a page) to be collecte开发者_Python百科d from the database. Simply caching the data for one hour means that every hour one user has to wait for the query to finish.

I would like to have something like this: The first user to request (expired) data from cache, will be delivered expired data. In the background, a separate thread is started which will update the cached data from the database. The next user will see fresh data.

Is there a standard solution for this, without having to do the caching oneself? Ideally, using ehcache & springmodules.

Thanks :)


Obviously, there is no out of the box solution.

We are going to implement our own interceptor.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜