Original Message:
Sent: Wed January 24, 2024 09:54 AM
From: Joseph Morgan
Subject: Configuring Document Cache Interval
Steve,
Are these policies extensions to any caching policy defined within an XML manager, or are they a complete override? That is, let's say I have three URL's defined in an XML manager of a MPGW. Then I load 3 different ones into the service variable. Does the service variable override the definitions of the XML manager?
Reading the documentation, it seems to be no different from the XML Manager document cache policy configuration, but maybe more convenient in a dynamically configured environment such as API Connect, when the policy might not be best statically configured.
------------------------------
Joseph Morgan
Original Message:
Sent: Wed January 24, 2024 09:22 AM
From: Steve Linn
Subject: Configuring Document Cache Interval
Hi RT,
Actually there is a way dynamically specify a document cache policy. It's called dynamic caching policies. Please see https://www.ibm.com/docs/en/datapower-gateway/10.5.0?topic=variables-varservicecachedynamic-policies for an example. In code you will build an XML document that has your url and associated caching options, including in your case your dynamic TTL, and then that is placed into var://service/cache/dynamic-policies. The API Connect v5 MPGW does exactly this with the invoke policy which is written in GatewayScript. You could also do this in a xslt stylesheet. The doc shows you simple examples of both.
Now if you're asking if once a backend response has been received and thus cached based upon either an XML Manager or dynamic doc cache policy, can I inspect the response (ie, a token in that response) and change after the fact the expiry of the already cache entry, that isn't possible in DataPower, but I'd think in this case you should be using protocol caching where the backend, based on the token, would specify the expiry in its response headers that DataPower would use when adding the response to the cache.
Best Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Mon January 22, 2024 01:07 PM
From: R K
Subject: Configuring Document Cache Interval
Thanks Joseph for the information. I am asking about document cache in MPGW Service. Is the TTL dynamically updated from the cache content in Datapower.
------------------------------
R K
Original Message:
Sent: Mon January 22, 2024 12:10 PM
From: Joseph Morgan
Subject: Configuring Document Cache Interval
Which cache? API, OAuth, Kerberos, etc?
Generally speaking, though you can explicitly invalidate and flush documents in the cache, I'm not sure if you can set individual caching intervals within DataPower's cache. You can code against the TTL of the token (if you are indeed storing in something like an encrypted or signed cookie) and explicitly invalidate and flush based upon that, provided the key is unique.
This is the domain of something more capable like eXtreme Scale, which allows setting an explicit expiration (TTL) per key.
------------------------------
Joseph Morgan
Original Message:
Sent: Mon January 22, 2024 04:36 AM
From: R K
Subject: Configuring Document Cache Interval
Hi.
Is there a way we can control the Cache Interval value based on the input request content. My use case is to store the token in Cache of Datapower service. Along with token, the validity of token will be sent in the response. Is there any way , the document cache Interval can be configured based on the validity of token?
------------------------------
R K
------------------------------