How does media_extractor & media_player work with chromecast?

I figure media extractor extracts the video from the URL and sends it to media player which then sends it to chromecast?

But is anything cached locally on home assistant? Can I configure cache or tune any other settings?
I experience lag sometimes I want to know if there is anything I can do to tune my setup.