Wouldn't this be quite difficult to upstream to users in the state presented?
At the least you'd want to make caching opt-in per macro unless something special was enabled. Forcing the end developer to blacklist incompatible macros feels like an anti-pattern.