rewrite generate cache.json part