Set cache mode