Fix #5680 by avoiding caching when block is not rendered properly.