In another life, maybe about 25 years ago, I did a few simple compressors in DSP code and I did toss in a delay on the audio, which is equivalent to a lookahead on the audio envelope. The delay was adjustable but, if I recall correctly, the default delay time was 4 time constants (maybe 5) of the first-order LPF that was filtering the amplitude of the audio.
In this drawing, it would be the length of the "Attack Phase" The idea was to allow the gain to settle to a stable value before the spike or edge in amplitude in the audio (that causes a gain change) arrives at the gain block.
I've also seen this done for limiters that were using a sliding max rather than a simple first-order LPF to smooth the amplitude.
How are you planning to determine the amplitude envelope of the audio, which is used in the gain adjustment function?