Move some cache-set validation into a validate callback.