added return value from writeToCache() to indicate whether cache was regenerated
shift responsibility for cache directory purging to requests that serve a server-cached image. Generating requests have already waited long enough.