An attempt to clean up ajax code related to cache