Cache clamp function