adjust cache according to config