Presentation is loading. Please wait.

Presentation is loading. Please wait.

View/Header and Footer to set Header information

Similar presentations


Presentation on theme: "View/Header and Footer to set Header information"— Presentation transcript:

1 View/Header and Footer to set Header information
9/10/2018 DataPower Caching Guidelines Version

2 What is caching? What is it?
Caching involves storing a temporary read-only copy of a file in a quick access location on the appliance. Why do it? Performance It is much faster to access local memory on the appliance than it is to fetch a file over the network. In addition, our appliances deal with such a volume of requests that the unix repositories wouldn’t be able to keep up without caching.

3 So we want to cache documents… but which ones? All of them

4 Okay so we’re caching everything… but for how long
Okay so we’re caching everything… but for how long? Short answer: Forever. Slightly longer answer: Forever, unless you have a very specific and approved deviation to not do so. There may be scenarios where we want the cache to expire after 24hrs for example if a file is being updated by a batch process. In general though, we want everything cached on the appliance forever. The goal is that once it is first accessed and cached that the appliance never have to go over the network again for it until the domain is recycled. Note: The appliance doesn’t actually understand what “forever” means so set the duration to which is the number of seconds in 367 days.

5 Cache Configuration Parameters (Basics)
Document Cache Count (DocCacheMaxDocs): The maximum number of documents that can fit in the cache. You’ll want to make sure that this is sufficiently large to store anything it has to. Make sure this is a positive number greater than 0 or it won’t cache anything. Document Cache Size (DocCacheSize): The maximum size in bytes of the cache. Again, you’ll want to make sure this is sufficiently large to store anything it has to. Don’t go overboard though as there’s a finite amount of storage space on the appliance. Make sure this is a positive number greater than 0 or it won’t cache anything. URL Match Expression (Match): A matching rule following file globbing patterns of what to cache. For example it could be *.xsd, *Event*.xml, or *.* Policy Type (Type): We almost always use ‘fixed’ as it’s the simplest. TTL (TTL): The length of time in seconds to cache the matched document for. When in doubt use

6 So how do we configure caching in DataPower?

7 GUI method

8 GUI method

9 GUI method

10 GUI method

11 Build Container method

12 Watch out! Great so now we’re caching everything forever but something weird is happening after deployments…. You can run into situations where the correct code is deployed to the repository but the service is behaving like it has some old values. This is likely because the system has cached old copies of the files and your deployment failed to flush all of the caches. This is really only an issue in DIT/SIT as the domain recycle in higher environments will indirectly flush the cache. If this happens to you, work with your deployment lead to update the flush-cache.xml Jenkins used during the deployment (or make sure you updated it for DIT).

13 Flush-cache.xml When you create a new XML Manager object you also need to update (or create if it’s a new domain) the flush-cache.xml file for HP deployments. This file is sent in to the appliance as one of the last steps in the promotion script to clear out the contents of the currently cached data. It does this by referencing XML Managers by name which is why you need to update it when you create new ones.

14 Flush-cache.xml <?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:env=" <env:Body> <dp:request domain=“Dev_SSAA_MAAD“ xmlns:dp=" <dp:do-action> <FlushDocumentCache> <XMLManager>default</XMLManager> </FlushDocumentCache> <FlushStylesheetCache> </FlushStylesheetCache> <XMLManager>xmlmgr_ma</XMLManager> </FlushStylesheetCache> </dp:do-action> </dp:request> </env:Body> </env:Envelope>

15 Do I have to do this for every project. Yes
Do I have to do this for every project? Yes. You need to pay attention to caching regardless of what you’re doing. If you’re creating a new component that has it’s own XML Manager then you have to make sure it’s configured correctly. You also have to make sure that HP’s UAT/PTE/PRD flush-cache.xml files are updated appropriately for the new XML Managers. If you’re adding a new operation to an existing system or otherwise touching an existing component you need to make sure it has sufficient caching capacity for any additional files.

16 flush-cache.xml in SIT Flush-cache.xml in SIT Jenkins also uses a flush-cache.xml file. Make sure you update it with any newly created XML Manager names.

17 Either a static file in bin directory or dynamic in build.xml
flush-cache.xml in DIT Flush-cache.xml in DIT Either a static file in bin directory or dynamic in build.xml <target name="flushcache-continued" if="Flush-Cache" description="Uses CURL to flush the XI50 cache with a SOAP call."> <echo file="${basedir}\bin\flushcache.xml"><?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:env=" <env:Body> <dp:request domain="${domain}" xmlns:dp=" <dp:do-action> <FlushDocumentCache> <XMLManager>default</XMLManager> </FlushDocumentCache> <FlushStylesheetCache> </FlushStylesheetCache> <XMLManager>xmlmgr_ccdb</XMLManager> </dp:do-action> </dp:request> </env:Body> </env:Envelope></echo>

18 Wait can’t there be an easy way to make these flush-cache. xml files
Wait can’t there be an easy way to make these flush-cache.xml files? There will be soon… a simple XSLT can parse a build container and produce the flush-cache file for it.

19 What if I need to flush the cache manually?

20 Checking Document Cache usage

21 Checking Stylesheet Cache usage


Download ppt "View/Header and Footer to set Header information"

Similar presentations


Ads by Google