This project is archived and is in readonly mode.
Gzip / Deflate support for ActiveResource
-
José Valim
Nice! +1
-
Rob Sanheim
+1
-
Michael Koziarski
- Assigned user set to Rick
-
Bart ten Brinke
- Tag changed from activeresource, patch to activeresource, patch, verified
Can this be included in 2.3? Would be a nice combination with the XML parsers.
-
Jeremy Kemper
- State changed from new to open
This is cool, but how are you passing Accept-Encoding in the first place?
Too late for 2.3 as we're down to the final release candidate.
-
Bart ten Brinke
Last line of the ticket:
To enable add this to your ActiveResource base class via a Mixin: base.headers['Accept-Encoding'] = 'deflate'
-
Bart ten Brinke
Is zlib packed with Rails 2.3? Because that will allow for some simplification of the patch. Too bad it's to late for 2.3.
-
Jeremy Kemper
zlib is part of the ruby standard library
-
Bart ten Brinke
Doh :) Repackaged. More tests + added an ActiveResource.enable_delfate option to set the headers for you.
-
Jeremy Kemper
Prefer not adding inflate! to net/http since it inflates AS for a special case. Could you use a utility method on the connection instead?
-
Bart ten Brinke
Gzip is something that really belongs in net/http as it is something you do to a packet.
-
Bart ten Brinke
Also I think net http should really support this as every thing that does http transfers will benefit from this.
-
Jeremy Kemper
It should, but that feature should be a patch to upstream net/http rather than hiding out in Active Support.
Then Active Resource can either use net/http's inflate support or fall back to its own utility method.
-
Bart ten Brinke
Problem is that body is a private attribute of HTTP::NET, so if all the magick is in AR, it would make the patch even more ugly.
-
Dean Radcliffe
Jeremy mentions both:
Prefer not adding inflate! to net/http since it inflates AS for a special case. then..
that feature should be a patch to upstream net/httpI hope this one makes it in somewhere. Theres zero performance penalty of having this option turned off, and the ability to shorten average request duration if turned on. It meets good usability standards as well.
D
-
Bart ten Brinke
I don't really understand the problem with patching HTTP:NET. They will probably never do it upstream because of the zlib requirements. Also rails already has a truckload of mix-ins for base ruby classes (take hash for example).
And as stated above. There is no penalty if left disabled.
-
Santiago Pastorino
- Importance changed from to
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale
