Sandra,
I believe this is certainly an area that needs more research. In my experience, 25 would be my upper cap and I would really prefer 20 to be my cap. You hit all the key elements that do effect the ratio. There is no "optimal" ratio alone without the contributing factors mentioned. I have seen online courses with 200 students and computer-graded assignments. The instructor only facilitates and answers questions as needed. There is little discussion and additional interaction. For some, that is acceptable. For those that believe there should be much more interaction in online courses (as I generally believe) then the ratio would need to be lower to provide the adequate feedback that students need. You articulated this nicely in your response.
Herbert Brown III