IF you can only do one of those, then behind & between the speakers will be more helpful because it will reduce boundary interference (that can cause dips in the frequency response) and minimize reflections in general off the front wall (that can muddy the front soundstage).
I've wondered about one thing. If the main concern is minimizing reflection from the front wall (wall behind the speakers), especially for rear ported speakers, perhaps it might be a better idea to plug the port itself - partially or fully - with foam or cloth or something else that has small holes in it so it makes it a near aperiodic kinda enclosure. Of course, I have no idea if it will mess up the speaker performance itself - mess up its T/S perhaps.
However, just using simple logic, i feel that if we are trying to minimize the reflection from the wall behind the speaker, why not eliminate it from the source itself (the port)? That is far easier to do.
For example, these aperiodic vents might be a good solution (and i feel would work far better than completely blocking the port). Perhaps there could be a homegrown solution for this as well - a port plug that does not fully block the port but lets some air through.
P.S. This will not work at all with my speakers as they are TL design and have a very large rear opening. But for bass reflex ported designs, this should work.