Before we can widely enable constraint checks, we need to cache constraint check results, otherwise the constraint checks will be too expensive.
NOTE: A task with this title previously appeared as T173696, but that has been re-purposed to more accurately fit the discussion that happened in it, which focused only one one aspect of caching.