Can someone help me understand the rear ported speaker distance to wall? Is more better?

I think, It is related to the port diameter. Is it also related to the minimum frequency response of the speaker itself ( I mean,58 Hz of the 58Hz - 22kHz +/- 3dB for CBM-170)?

Thanks,
Aravind