In the above examples, game tick caching is used. So in the same processing slot, while Warzone is paused waiting for scripts to process events, if your script requests the same list of structures or droids more than once (which is surprisingly common) the first request will get fresh data and cache it, whilst subsequent requests will be given the cached data. Because gameTime is paused during a processing slot, the data won't be changing anyway, and caching it has virtually no overhead (other than using a little RAM), so the performance improvements can be quite noticeable, especially on complex scripts.
Working out what to cache does require some insight in to your code, the data it works with and the time it takes to generate, etc., but most script developers will surely see many obvious scenarios in which the Cache API can reduce processing overheads and boost performance of their scripts. In some cases, code refactoring may be required to get the maximum advantage from using Cache API. For example, if you regularly refer to big lists of enemy droids, maybe you can cache that list for a few seconds and alter your code to deal with any errors caused by droids in the list being destroyed or new droids appearing on the map.
If you like the Cache API, I recommend you also take a look at the Process API – it allows you to perform slow tasks over multiple game ticks to avoid game lag, an