If the client accepts gzip, just serve the file as a gzip-encoded plain text. If it doesn't, gunzip it first.