[close #295] correctly clear cache after version change

This doesn't solve the problem for apps who have already switched versions and have bloated caches.