Hamu full rewrite for caching