Working rewrite and caching of json files