You can not "blindly" gzip your data unless you control the clients.
It's the client that tells if it can accept gzip content or not,
and the web server will choose to gzip it or not.

I will advice you to let this to the web server.

But if you really want to gzip yourself, than you should take care of the
request headers, specifically the Accept-Encoding one, ex:

Accept-Encoding: gzip, deflate

than if you gzip you should tell the client about it in the response
headers with:

Content-Encoding: gzip


http://en.wikipedia.org/wiki/HTTP_compression

Ricardo


On Sun, Apr 21, 2013 at 9:59 PM, Vincent <vincentchevr...@gmail.com> wrote:
> Hi,
>
> I want to return gzipped json content (although the json part is not really
> important).
>
> I did some googling and found this post which is somewhat related,
> https://groups.google.com/d/msg/web2py/cgSrsC73vzg/ZNYN3u7ChVwJ
> as far as I could tell the minify part of the question was answered but not
> the gzipped part.
>
> I know some servers can compress, but I want to do the compression inside
> web2py since my app may run on various server  configurations. My objective
> is to serve experimental data through a RESTful service.
>
> Basically, I am wondering if something like "generic.json.gz" already exists
> built-in to web2py. Something that returns the gzipped form of the json of
> the response.
>
> Does this already exist somewhere or do I need to write it myself?
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to