Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion [2.0] [Scala] Using sbt code generators to generate hashes of assets to optimize caching

Received: by 10.68.236.198 with SMTP id uw6mr2452080pbc.3.1334127980503;
        Wed, 11 Apr 2012 00:06:20 -0700 (PDT)
X-BeenThere: play-framework@googlegroups.com
Received: by 10.68.222.193 with SMTP id qo1ls2672236pbc.9.gmail; Wed, 11 Apr
 2012 00:06:12 -0700 (PDT)
Received: by 10.68.136.106 with SMTP id pz10mr2461019pbb.16.1334127972855;
        Wed, 11 Apr 2012 00:06:12 -0700 (PDT)
Date: Wed, 11 Apr 2012 00:06:05 -0700 (PDT)
From: Julien Tournay <boudhe...@gmail.com>
To: play-framework@googlegroups.com
Message-ID: <7629246.2366.1334127965505.JavaMail.geo-discussion-forums@pbcpw7>
In-Reply-To: <3E4246E2-612B-44F0-A25E-5AC3B9933253@venarc.com>
References: <ED6AC656-054E-4151-9C0A-A4BBC3733A7E@venarc.com> <816C8D46-DAB8-4778-B8D7-1DA204E2C401@venarc.com> <27458686.528.1334087631211.JavaMail.geo-discussion-forums@pbcvc5> <6CFD09AB-2ACE-4FFC-9AFE-B32AD192A66C@venarc.com> <2180073.1476.1334092880622.JavaMail.geo-discussion-forums@pbtr10> <0296B765-3A80-48D6-B390-FEFDD90965F8@venarc.com> <21120251.471.1334105554154.JavaMail.geo-discussion-forums@pbjk8> <A43500D6-92A2-4364-B4C2-E6644416C1F6@venarc.com> <CAHte5+JQcLhT_YP3mx_iboUfJHnv6BdvHBMu6wGjrp3Rgbnn=Q@mail.gmail.com> <14791725.5.1334106955514.JavaMail.geo-discussion-forums@pbso10> <CAHte5++WHTdk8t+rOGWzbobjzstzGF+OyEjyY9sGDnspHMu--w@mail.gmail.com>
 <3E4246E2-612B-44F0-A25E-5AC3B9933253@venarc.com>
Subject: Re: [play-framework] [2.0] [Scala] Using sbt code generators to
 generate hashes of assets to optimize caching
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2364_17337039.1334127965505"

------=_Part_2364_17337039.1334127965505
Content-Type: multipart/alternative; 
	boundary="----=_Part_2365_30482340.1334127965505"

------=_Part_2365_30482340.1334127965505
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

No, as I said you can do that on application start in your Global object.=
=20
It definitely does not have to be mutable.

jto.

Le mardi 10 avril 2012 18:40:22 UTC-7, Drew Kutcharian a =C3=A9crit :
>
> Doing it runtime is definitely easier but at the cost of having a mutable=
=20
> state in a possibly hot area and risk of race conditions. (I'm not even=
=20
> sure if it can be done, how would you know the hash of a resource without=
=20
> first computing it?)
>
> As far as proxies not caching resources with an '?', the URL can be=20
> changes to www.myapp.com/assset/images/foo.png/<md5(foo.png)>
>
> -- Drew
>
> On Apr 10, 2012, at 6:35 PM, Eric Jain wrote:
>
> > On Tue, Apr 10, 2012 at 18:15, Julien Tournay <boudhe...@gmail.com>=20
> wrote:
> >> You don't have to change the Asset I think.
> >> If the reverse router was just adding a query param to the path, the=
=20
> Asset
> >> would still work.
> >=20
> > Yes; I was talking about the Asset controller because I thought
> > routes.Assets is generated from controllers.Assets?
> >=20
> >=20
> >> basically www.myapp.com/asset/images/foo.png?v1 instead
> >> of www.myapp.com/asset/images/foo.png
> >>=20
> >> Would that work with reverse proxies ?
> >=20
> > Yes. But some proxies won't cache resources with a '?' [1], so it
> > might be a good idea to use foo.v1.png instead of foo.png?v1.
> >=20
> > [1]=20
> https://developers.google.com/speed/docs/best-practices/caching#LeverageP=
roxyCaching
> >=20
> > --=20
> > You received this message because you are subscribed to the Google=20
> Groups "play-framework" group.
> > To post to this group, send email to play-framework@googlegroups.com.
> > To unsubscribe from this group, send email to=20
> play-framework+unsubscribe@googlegroups.com.
> > For more options, visit this group at=20
> http://groups.google.com/group/play-framework?hl=3Den.
> >=20
>
>
------=_Part_2365_30482340.1334127965505
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

No, as I said you can do that on application start in your Global object. I=
t definitely does not have to be mutable.<div><br></div><div>jto.<br><br>Le=
 mardi 10 avril 2012 18:40:22 UTC-7, Drew Kutcharian a =C3=A9crit&nbsp;:<bl=
ockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border=
-left: 1px #ccc solid;padding-left: 1ex;">Doing it runtime is definitely ea=
sier but at the cost of having a mutable state in a possibly hot area and r=
isk of race conditions. (I'm not even sure if it can be done, how would you=
 know the hash of a resource without first computing it?)<p>As far as proxi=
es not caching resources with an '?', the URL can be changes to <a href=3D"=
http://www.myapp.com/assset/images/foo.png/" target=3D"_blank">www.myapp.co=
m/assset/images/<wbr>foo.png/</a>&lt;md5(foo.png)&gt;</p><p>-- Drew</p><p>O=
n Apr 10, 2012, at 6:35 PM, Eric Jain wrote:</p><p>&gt; On Tue, Apr 10, 201=
2 at 18:15, Julien Tournay &lt;<a href=3D"mailto:boudhe...@gmail.com" targe=
t=3D"_blank">boudhe...@gmail.com</a>&gt; wrote:<br>&gt;&gt; You don't have =
to change the Asset I think.<br>&gt;&gt; If the reverse router was just add=
ing a query param to the path, the Asset<br>&gt;&gt; would still work.<br>&=
gt; <br>&gt; Yes; I was talking about the Asset controller because I though=
t<br>&gt; routes.Assets is generated from controllers.Assets?<br>&gt; <br>&=
gt; <br>&gt;&gt; basically <a href=3D"http://www.myapp.com/asset/images/foo=
.png?v1" target=3D"_blank">www.myapp.com/asset/images/<wbr>foo.png?v1</a> i=
nstead<br>&gt;&gt; of <a href=3D"http://www.myapp.com/asset/images/foo.png"=
 target=3D"_blank">www.myapp.com/asset/images/<wbr>foo.png</a><br>&gt;&gt; =
<br>&gt;&gt; Would that work with reverse proxies ?<br>&gt; <br>&gt; Yes. B=
ut some proxies won't cache resources with a '?' [1], so it<br>&gt; might b=
e a good idea to use foo.v1.png instead of foo.png?v1.<br>&gt; <br>&gt; [1]=
 <a href=3D"https://developers.google.com/speed/docs/best-practices/caching=
#LeverageProxyCaching" target=3D"_blank">https://developers.google.com/<wbr=
>speed/docs/best-practices/<wbr>caching#LeverageProxyCaching</a><br>&gt; <b=
r>&gt; -- <br>&gt; You received this message because you are subscribed to =
the Google Groups "play-framework" group.<br>&gt; To post to this group, se=
nd email to <a href=3D"mailto:play-framework@googlegroups.com" target=3D"_b=
lank">play-framework@googlegroups.<wbr>com</a>.<br>&gt; To unsubscribe from=
 this group, send email to <a href=3D"mailto:play-framework%2Bunsubscribe@g=
ooglegroups.com" target=3D"_blank">play-framework+unsubscribe@<wbr>googlegr=
oups.com</a>.<br>&gt; For more options, visit this group at <a href=3D"http=
://groups.google.com/group/play-framework?hl=3Den" target=3D"_blank">http:/=
/groups.google.com/<wbr>group/play-framework?hl=3Den</a>.<br>&gt; </p><p></=
p><p></p><p></p><p></p><p></p></blockquote></div>
------=_Part_2365_30482340.1334127965505--

------=_Part_2364_17337039.1334127965505--