P2: If this is the function where we get from the cache it should preferably also be the one where we set it. That makes the code easier to understand.

Also: When we have a result we might as well update the static cache immediately.