Fixed queries writing to same cache file