moved cache write to jobs.py