An intelligent cache