Message from discussion
Is Rails 4 going to render JSON as a stream by default?
Received: by 10.181.13.75 with SMTP id ew11mr623739wid.0.1351779846912;
Thu, 01 Nov 2012 07:24:06 -0700 (PDT)
X-BeenThere: rubyonrails-core@googlegroups.com
Received: by 10.180.105.1 with SMTP id gi1ls1141979wib.2.canary; Thu, 01 Nov
2012 07:23:51 -0700 (PDT)
Received: by 10.180.75.197 with SMTP id e5mr615031wiw.1.1351779831127;
Thu, 01 Nov 2012 07:23:51 -0700 (PDT)
Received: by 10.180.75.197 with SMTP id e5mr615030wiw.1.1351779831103;
Thu, 01 Nov 2012 07:23:51 -0700 (PDT)
Return-Path: <dro...@gmail.com>
Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173])
by gmr-mx.google.com with ESMTPS id cn9si87687wib.0.2012.11.01.07.23.51
(version=TLSv1/SSLv3 cipher=OTHER);
Thu, 01 Nov 2012 07:23:51 -0700 (PDT)
Received-SPF: pass (google.com: domain of dro...@gmail.com designates 209.85.212.173 as permitted sender) client-ip=209.85.212.173;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of dro...@gmail.com designates 209.85.212.173 as permitted sender) smtp.mail=dro...@gmail.com; dkim=pass header...@gmail.com
Received: by mail-wi0-f173.google.com with SMTP id hm4so307651wib.2
for <rubyonrails-core@googlegroups.com>; Thu, 01 Nov 2012 07:23:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:in-reply-to:references:date:message-id:subject:from:to
:content-type;
bh=NUA5sGaEnadcGJs6bEsVZvb4gbymrSOfFSe95DLRygU=;
b=Nx3Xsa+JLE2zONlt++RDzrJb6VCla8a1+N5HWRgllhzfO2qkWGUBrubOLXknYpDh3S
HUa2Hm9KpUOZTWOdgG+wMfU+XkParJr9rvHK63n/FCNMjojO00tAZW7HFhUxX/D6ea3C
HxjsfsBN7V0ETN9uBDBzUa9SZvPzLwM+VFGa34ZARfO14LsMPhdK/8c5scFGI/E2S+Ng
TV1xKATqdrbU5uf4LRRq05qao7pVEScurvPPM6BwDmg4snjAfTNBVXJ6LWLeH8n8QO33
CEgkSndqnBrgAwDdotPUNC8fRX7jl/u8mvIxRsDFhj9sgy/zR0ZGUI62oxN3ov3oKG1p
gR/A==
MIME-Version: 1.0
Received: by 10.180.8.197 with SMTP id t5mr2203871wia.5.1351779830853; Thu, 01
Nov 2012 07:23:50 -0700 (PDT)
Received: by 10.227.134.65 with HTTP; Thu, 1 Nov 2012 07:23:50 -0700 (PDT)
In-Reply-To: <509283DA.2010...@gmail.com>
References: <509283DA.2010...@gmail.com>
Date: Thu, 1 Nov 2012 15:23:50 +0100
Message-ID: <CAHyd2SZbWKKx5_RTM-G2r0KYdG4GNTtAXZPbwvDWUWGDZ9A...@mail.gmail.com>
Subject: Re: [Rails-core] Is Rails 4 going to render JSON as a stream by default?
From: Piotr Sarnacki <dro...@gmail.com>
To: rubyonrails-core@googlegroups.com
Content-Type: multipart/alternative; boundary=f46d04428240a1ef4904cd6fc455
--f46d04428240a1ef4904cd6fc455
Content-Type: text/plain; charset=UTF-8
As far as I know there is no plans to make it the default, but nothing
stops you from using ActionController::Live to stream JSON as soon as you
generate it.
On Thu, Nov 1, 2012 at 3:14 PM, Rodrigo Rosenfeld Rosas
<rr.ro...@gmail.com>wrote:
> I have some pretty big data to be encoded to JSON in my application and it
> would be faster if rendering my data as JSON could be done with a stream
> response.
>
> So, if the network is the bottleneck, the clients wouldn't notice some
> seconds of delay before starting to receive the JSON response that is
> required for the server to process JSON encoding before starting to send it
> to the client...
>
> Are you considering any kind of optimization like this for Rails 4?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To post to this group, send email to rubyonrails-core@googlegroups.**com<rubyonrails-core@googlegroups.com>
> .
> To unsubscribe from this group, send email to
> rubyonrails-core+unsubscribe@**googlegroups.com<rubyonrails-core%2Bunsubscribe@googlegroups.com>
> .
> For more options, visit this group at http://groups.google.com/**
> group/rubyonrails-core?hl=en<http://groups.google.com/group/rubyonrails-core?hl=en>
> .
>
>
--
Piotr Sarnacki
http://piotrsarnacki.com
--f46d04428240a1ef4904cd6fc455
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
As far as I know there is no plans to make it the default, but nothing stop=
s you from using ActionController::Live to stream JSON as soon as you gener=
ate it.<br><br><div class=3D"gmail_quote">On Thu, Nov 1, 2012 at 3:14 PM, R=
odrigo Rosenfeld Rosas <span dir=3D"ltr"><<a href=3D"mailto:rr.rosas@gma=
il.com" target=3D"_blank">rr.ro...@gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">I have some pretty big data to be encoded to=
JSON in my application and it would be faster if rendering my data as JSON=
could be done with a stream response.<br>
<br>
So, if the network is the bottleneck, the clients wouldn't notice some =
seconds of delay before starting to receive the JSON response that is requi=
red for the server to process JSON encoding before starting to send it to t=
he client...<br>
<br>
Are you considering any kind of optimization like this for Rails 4?<span cl=
ass=3D"HOEnZb"><font color=3D"#888888"><br>
<br>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;Ruby on Rails: Core" group.<br>
To post to this group, send email to <a href=3D"mailto:rubyonrails-core@goo=
glegroups.com" target=3D"_blank">rubyonrails-core@googlegroups.<u></u>com</=
a>.<br>
To unsubscribe from this group, send email to <a href=3D"mailto:rubyonrails=
-core%2Bunsubscribe@googlegroups.com" target=3D"_blank">rubyonrails-core+un=
subscribe@<u></u>googlegroups.com</a>.<br>
For more options, visit this group at <a href=3D"http://groups.google.com/g=
roup/rubyonrails-core?hl=3Den" target=3D"_blank">http://groups.google.com/<=
u></u>group/rubyonrails-core?hl=3Den</a>.<br>
<br>
</font></span></blockquote></div><br><br clear=3D"all"><div><br></div>-- <b=
r>Piotr Sarnacki<br><a href=3D"http://piotrsarnacki.com">http://piotrsarnac=
ki.com</a><br>
--f46d04428240a1ef4904cd6fc455--