complete first version of stream cache