Revert "Simplified Precache script."

This reverts commit f4afc04d1f7c7ecf3df90b3d9b7f0708c1f69cb9.