Write JSON before updating cache, removes redundant loading