There's a graphic flow dighram in the book that shows the order of things. That's the best way to get this. The rest is just clearing up the terminalogy.
"if you have volume decrease envelopes and then =apply= compression..."
Do you mean =insert= a compressor into the track effects bin? Then the volume control (track fader or volume envelope) is after (post) the compressor. No matter what the comp does, the fader still has final control.
"...then the volume gets boosted back up thus compromising the envelope effect.."
Aside that compressors pull gains down, not boost them, it's still no.
" - but if i use post gain (whatever that is ) then i escape this issue ?"
Yes. And the track fader is post gain, compared to where this compressor is.
But there is a second set of controls that are before everything. I called them the Trim knob or 'gain envelopes' (but that might be worng. We need to look this up.

They might be called 'clip envelopes') But the compressor would tend to undo change made there.