This is likely cache implementation specific, but you could probably just requesting a session once and storing it in the current request, any other reads for that request would get the local copy.
This would NOT be fool proof as multiple requests could update information in the session, and you could end up with stale cache. On Mon, Dec 19, 2016 at 8:13 AM, Curtis Wittner <[email protected]> wrote: > I am also interested. I am using zookeeper for my session cache and have > had to implement storing the sessions in memory as well so that the cache > get process can pull from memory unless the zookeeper instance has been > updated. > > > Curtis Wittner > Senior Software Developer > Integrated Services, Inc. > [email protected] > www.ints.com > P:800-252-3099 x 235 <(800)%20252-3099> > F:503-968-9100 <(503)%20968-9100> > > On Sun, Dec 18, 2016 at 12:18 PM, Rob Young <[email protected]> wrote: > >> I’m massively interested in the answer to this question. I need to >> implement user session caching at some point in a Shiro web application, I >> feel like this is one of those questions whose answer would be quite >> instructive! >> >> > On Dec 18, 2016, at 10:08 AM, Guofeng Zhang <[email protected]> >> wrote: >> > >> > Hi, >> > >> > I created a session dao to store the shiro session to Redis so that the >> session could be shared across several application instances. But I found >> that the doReadSession() and doUpdateSession() are invoked many many times >> for a sing request and cause my application runs very slow in the heavy >> load. >> > >> > Is there any way to make it more efficient? >> > >> > Your advice is appreciated. >> > >> > Thanks, >> > >> > Guofeng >> > >> > >> > >> >> >
