Optimal would depend on the situation, but you know that. Then, the question becomes: how do I learn to be ready for any jump+missile situation?
And that answer is not an easy one. If you're really really new, I'd start off with Pokemon stadium and platform canceling those missiles up and down till you can do it by only sound for 30 seconds*. Then, if you're beyond that, I'd go for weak missile platform cancel up and down till you can do it for 10 seconds....with only sound...on Battlefield*.
But then you'll ask, "What about those damn low Sheiks and Jiggs?" That's where you practice short hop FF missile cancel. 25 in a row should be good*.
Once you get the height down of the lowest possible missile you can do, go to a stage with a top platform and drop through FF and missile cancel at it's lowest. 15 in a row*.
But then you'll ask, "What about those damn Marths, Foxes and Falco that vary height?" That's where you'll practice full jump double missile. 25 in a row is good*. Oh! and I know switching one of the double missiles is alright, but I don't think it's possible to full jump double weak missile...I could be wrong on that.
(Am I talking too much? I feel like I'm talking too much)
Once that is done, you'll be close to frame perfect shuffling mixing aerials and missiles then you're focus should to become butter....or a babies bottom, you know, smooth.
*All recommendations are arbitrary, but I think anyone would agree that master-level missile technique has been achieved when completed.