In place (same location) and on the fly -- I do not think so.
What you can TRY:
Set up File Watcher that will do automatically perform such compression after file is saved (file watcher will execute any external batch/script/executable file you point to -- such script just need to save encoded file in different location or with different file name)
Then upload such encoded file to your server (deployment may pick it up automatically. If not -- use "File | Sync" to force re-reading local files .. and if auto deployment of external changes is turned on, it should upload it).
I do not guarantee that this idea will work 100% (have no need for it and have not tried this myself) .. but it should (at least I believe so, if configured properly).