Rewrite caching