Cache validation result.

Rebased version of #303/#290
Ah, I see you have rebased from someone else's patches.