AlexCuse / SquishIt.S3

SquishIt integration with Amazon S3
8 stars 2 forks source link

WithGZipCompressionEnabled method #8

Closed jasonirwin closed 12 years ago

jasonirwin commented 12 years ago

Hi Alex, I've committed the first draft of the WithGZipCompressionEnabled method and the backing functionality required to zip the content. It works well. If I have any concern it is the need to create a second UploadCompressedContent method. This is required as the AWS PutObjectRequest is performed using a memory stream and not a string. My efforts to save to a string and upload via the WithContentBody method have been unsuccessful (though you'd think this would be straightforward). Cheers Jason

AlexCuse commented 12 years ago

If you want to try pulling my changes, I put all the uploads through a single method that takes a stream. I don't think it will break anything but haven't done a real test yet.

I also made the .WithCompression method internal (and renamed it to .WithCompressor) so we can use it for testing but only expose .WithGzipCompressionEnabled in the API. Just need to add another test to confirm that the compression headers don't get overwritten if we call .WithHeaders after enabling compression.