fix cache broken, ensure tmp/cache exists