The bars are small, so yes, if you've cast force cage with bars on a fly, it will escape. Otherwise you will need to be able to teleport to get out. As for attacking, no, I wouldn't allow someone to attack through a half in space when the bars are invisible, unless they could see invisible objects, and then there would be disadvantage. Casting spells would work, though, but then you'd only lock up a martial enemy in that kind of cage, not a spellcasting one. For example, a Champion or Battle Master would be screwed.