“Should you encrypt or compress first?”
There's no compress or encrypt _first_.<p>It's just compress or not, before encrypting. If security is important, the answer to that is no, unless you're an expert and familiar with CRIME and related attacks.<p>Compression after encryption is useless, as there should be NO recognizable patterns to exploit after the encryption.