It's quite depressing that we can't have both compression and encryption at the same time - text is very compressible - particularly HTML markup...
In practice, there isn't a way I know of to mark the relevant parts of the response body so that the compression, which is usually done as a separate post-processing step, will know to avoid compressing these parts of the stream. And it would be very fragile; forgetting to mark a secret as "do not compress this" would work perfectly fine but reintroduce the vulnerability.
So only compress when sending over the wire?
Encrypted data is supposed to look random, and as a consequence, it tends to compress very poorly.