I know pywikibot does some kind of API cacheing, but I can't find any details of what it keys on and how deterministic it is.
The behavior I want is "I know the revid from the last time I fetched this page. Either give that to me out of the cache, or fetch the latest version and update the cache with that".