Skip to content

Commit

Permalink
Merge pull request #100 from NHSDigital/AMB-1622-Implement-caching
Browse files Browse the repository at this point in the history
Amb 1622 implement caching
  • Loading branch information
ewan-IW committed Sep 1, 2023
2 parents 6832c09 + a0d00fa commit bdfa95e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
10 changes: 10 additions & 0 deletions proxies/live/apiproxy/policies/LookupCache.PDSAccessToken.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<LookupCache async="false" continueOnError="false" enabled="true" name="LookupCache.PDSAccessToken">
<DisplayName>LookupCache.PDSAccessToken</DisplayName>
<Properties/>
<Scope>Exclusive</Scope>
<CacheKey>
<KeyFragment>PDSAccessToken</KeyFragment>
</CacheKey>
<AssignTo>PDSAccessToken</AssignTo>
</LookupCache>
13 changes: 13 additions & 0 deletions proxies/live/apiproxy/policies/PopulateCache.PDSAccessToken.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PopulateCache async="false" continueOnError="false" enabled="true" name="PopulateCache.PDSAccessToken">
<DisplayName>PopulateCache.PDSAccessToken</DisplayName>
<Properties/>
<Scope>Exclusive</Scope>
<CacheKey>
<KeyFragment>PDSAccessToken</KeyFragment>
</CacheKey>
<ExpirySettings>
<TimeoutInSec>300</TimeoutInSec>
</ExpirySettings>
<Source>PDSAccessToken</Source>
</PopulateCache>
9 changes: 9 additions & 0 deletions proxies/live/apiproxy/targets/target.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,20 @@
<Step>
<Name>GenerateJWT.PDSClientAssertion</Name>
</Step>
<Step>
<Name>LookupCache.PDSAccessToken</Name>
</Step>
<Step>
<Name>ServiceCallout.AuthenticateForPDS</Name>
<Condition>lookupcache.LookupCache.PDSAccessToken.cachehit == false</Condition>
</Step>
<Step>
<Name>JavaScript.GetPDSAccessToken</Name>
<Condition>lookupcache.LookupCache.PDSAccessToken.cachehit == false</Condition>
</Step>
<Step>
<Name>PopulateCache.PDSAccessToken</Name>
<Condition>lookupcache.LookupCache.PDSAccessToken.cachehit == false</Condition>
</Step>
<Step>
<Name>ServiceCallout.GetODSCode</Name>
Expand Down

0 comments on commit bdfa95e

Please sign in to comment.