How does a semantic cache work?