(The contents of lmdb cache is what is cached by a remote cache, I’m going to guess you mean a named cache.)
Not sure about optimising. The only general one I can think of is to preserve it usually but regularly clear it when it is too large, so most builds benefit but not all:
https://www.pantsbuild.org/2.21/docs/using-pants/using-pants-in-ci “nuking the cache when too big”
You could investigate mypy-specific optimisations, eg understand what is in the mypy cache and work out what can be deleted (etc.). This’ll be a balance of pants and mypy behaviour, but mostly mypy I suspect.
Re named caches -> remote cache, I don’t think there’s a current possibility for that.