I'd like to refine this a bit more. The upper end of numbers i talked about 200-300 cache hits is for a page, not a request - but it's still very high.
For reference, hitting just a static CSS file which is under the shiro filter hits the cache around 25 times. When you add up all the page elements, it's up there. I still trying to figure out if this is "by design". Ideally, you'd want to retrieve it from the cache at the start of a request and keep a local copy until the request ends. At that point, you can update the cache item if relevant. I'd consider a request an atomic action for consistency's sake. If it really does get/put multiple times during a request, and if the session is clustered, there is a possibility that will modify the session state of another request on a different machine while that request is still being processed which might render it inconsistent. If you keep session work to a minimum (only principal info), this shouldn't really happen in reality but still the # of calls will flood any distributed cache/storage. -- View this message in context: http://shiro-user.582556.n2.nabble.com/Cache-called-too-many-times-per-request-tp6851915p6853251.html Sent from the Shiro User mailing list archive at Nabble.com.
