Update cachecontrol.c

Optimization algorithm.