Cache made more flexible