Use copy because deepcopy causes problems with the cache object