Showing posts with label webgate profile.tune webgate cache. Show all posts
Showing posts with label webgate profile.tune webgate cache. Show all posts

Thursday 4 December 2014

Webgate Caches: Understanding the Webgate Caching

We will be discussing the following:


  1. When WebGate do the caching? At what time?
  2. Why it is required to cache?
  3. How it uses this cache?
  4. How to tune this cache?
  5. Webgate Caching Demo



1) When WebGate do the caching? At what time?

      Basically Webgate caches the information: 

    • At the time of Authentication & 
    • Authorization.

2) Why it is required to cache?

It is important to do the caching when we don't want the OAM Server to get overloaded.
And what does this means actually?

It means that if the webgate starts sending every similar request to the server, it is actually not adding any value. We are just asking the server to do the repetitive task.

But what if we can make these request a screening at webgate. What if webgate first looks to the request if found it has already served it than webgate takes the decision. As webgate already has the answer cached. And in case webgate doesn't have any info about the user request than it will make a trip to server asking for the same & hence caching it for future use.


3) So does it means that webgate caches the request for lifetime?

No, absolutely not. It do cache, but certainly it too have a life. And its life is depends on the configuration that we do while creating the Webgate Profile.


4) What all parameters do take care of caching in OAM?

    As discussed there are 2 types of caches:

    • Authentication &
    • Authorization
Parameters:
  1. Authentication Cache Configurable Parameters:
    1. Maximum Cache Elements
    2. Cache Timeout
  2. Authorization User Defined Parameters:
    1. maxAuthorizationResultCacheElems
    2. authorizationResultCacheTimeout  

5) Now the question comes that how these caches comes into picture? As in how webgate actually uses it?


Basically when user request comes to the webgate (obviously via a server where webgate is integrated), at that time a lookup is made to the cache. Now first look up is made to authentication cache for the required parameters & than look up is made to authorization cache.

Now the interesting point here is that in case cache miss hit occurs than a NAP/OAP call is made to the server, & the response is actually cached. So that next tym if the same request comes to the webgate before cache timeout than webgate has the capability to respond & do look up.

6) Tuning the webgate cache parameters:


As discussed at point (4), the parameters defined can be configured:
  • Max cache elements: If we configure this parameter as -1, than webgate will not cache the elements.
  • Cache Timeout: It tells after how much time will the cache drains out. If Max Cache Elements is configured as -1, than this parameter has no significance.
  • maxAuthorizationResultCacheElems - This user defined parameter will set the max number of authorization cache elements that can be cached. 
  • authorizationResultCacheTimeout - this is same a cache timeout but this is specifically for authorization cache. It has no impact on authentication cache. Default value is 15 seconds.
    • If authorizationResultCacheTimeout is set to 0, Authorization Cache is disabled.

Reference Docs: http://docs.oracle.com/cd/E27559_01/doc.1112/e28552/oam.htm#ASPER490



Enjoy :-)