You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by stephanos <st...@gmail.com> on 2010/10/14 22:05:31 UTC

Fetch Prototype library via Google DNS?

How can I configure Tapestry to fetch the Javascript Prototype library from
the  http://code.google.com/apis/libraries/devguide.html#prototype Google
DNS server ? 

Cheers! 
Stephan
-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/Fetch-Prototype-library-via-Google-DNS-tp3212754p3212754.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Fetch Prototype library via Google DNS?

Posted by ael <al...@dash.com.ph>.
You can configure the Tapestry Scriptaculous Path to get prototype library in
google.

I think that will do the trick. :)
-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/Fetch-Prototype-library-via-Google-DNS-tp3212754p3213027.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Fetch Prototype library via Google DNS?

Posted by Howard Lewis Ship <hl...@gmail.com>.
On Fri, Oct 15, 2010 at 10:29 AM, Michael Gentry <mg...@masslight.net> wrote:
> I'm not sure this always makes sense to do.  One of our applications
> has a couple wizard-like interfaces where you answer a few items and
> move through until the end.  Each page had a tiny little bit of
> page-specific JavaScript to be delivered in addition to the common
> JavaScript (Prototype, Tapestry, etc).  If Tapestry is always
> re-packaging all of the JavaScript, plus the small page-specific
> JavaScript, into a single JavaScript file, isn't this more wasteful?
> The browser can't cache Prototype, but has to re-download it each
> time, right?
>

That is exactly what drove the changes in JavaScript aggregation for
5.2.  What's you'll see now is a request for a core.js (the core
JavaScript stack: prototype, etc.) plus additional requests for each
"non-stack" JS file (if any).

In both 5.1 and 5.2, per-page JavaScript initialization is in a <script> tag.

> Thanks,
>
> mrg
>
>
> On Fri, Oct 15, 2010 at 12:19 PM, Howard Lewis Ship <hl...@gmail.com> wrote:
>> That article doesn't take into account the things that Tapestry does for you:
>> - Combines prototype.js with other JS files to form a single JS file
>> (this is done on-the-fly)
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Fetch Prototype library via Google DNS?

Posted by Michael Gentry <mg...@masslight.net>.
I'm not sure this always makes sense to do.  One of our applications
has a couple wizard-like interfaces where you answer a few items and
move through until the end.  Each page had a tiny little bit of
page-specific JavaScript to be delivered in addition to the common
JavaScript (Prototype, Tapestry, etc).  If Tapestry is always
re-packaging all of the JavaScript, plus the small page-specific
JavaScript, into a single JavaScript file, isn't this more wasteful?
The browser can't cache Prototype, but has to re-download it each
time, right?

Thanks,

mrg


On Fri, Oct 15, 2010 at 12:19 PM, Howard Lewis Ship <hl...@gmail.com> wrote:
> That article doesn't take into account the things that Tapestry does for you:
> - Combines prototype.js with other JS files to form a single JS file
> (this is done on-the-fly)
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Fetch Prototype library via Google DNS?

Posted by Kalle Korhonen <ka...@gmail.com>.
On Fri, Oct 15, 2010 at 9:59 AM, Howard Lewis Ship <hl...@gmail.com> wrote:
> On Fri, Oct 15, 2010 at 9:51 AM, Kalle Korhonen
> <ka...@gmail.com> wrote:
>> On Fri, Oct 15, 2010 at 9:19 AM, Howard Lewis Ship <hl...@gmail.com> wrote:
>>> On Fri, Oct 15, 2010 at 1:34 AM, stephanos <st...@gmail.com> wrote:
>>>> http://encosia.com/2008/12/10/3-reasons-why-you-should-let-google-host-jquery-for-you/
>>>> advantages  obviously are reduced traffic+CPU for the server, decreased
>>> The only real advantage to fetching from Google is that the browser
>> Using a CDN for loading heavy elements is free from web site's
>> perspective and it can be done with Tapestry, but it just makes it
>> needlessly difficult to do so.
> Patches welcome!

Depends on the patch, eh? :) But in all seriousness, like the majority
of my other "enhancements", they are not good/generalized enough for
general use. Probably not worth doing it for 5.1 anymore. Now things
have changed sufficiently in 5.2 that it may require a different take.
Perhaps I'll make an effort for a patch once I get to it unless
somebody else gets there first.

Kalle


>>>> At first I wanted to do it quickly because it seemed to be a quick win - but
>>>> the more I struggled with Tapestry to do this, the more it was about just
>>>> getting it to do it :)
>>>>
>>>> There was a
>>>> http://tapestry.1045711.n5.nabble.com/Tapestry-Central-Tapestry-5-1-and-IE-8-Customizing-Tapestry-td2436846.html#a2436848
>>>> thread  about this topic almost a year ago - with no real solution. The last
>>>> entry only says 'U could create a new "URIAssetFactory" to obtain assets
>>>> from a
>>>> external resource' - but I wouldn't even know where to start. I assumed this
>>>> might interest other people too, hence the post here :)
>>>>
>>>>
>>>>> You can configure the Tapestry Scriptaculous Path to get prototype library
>>>>> in google.
>>>>
>>>> Isn't that an oxymoron? Setting the 'tapestry.scriptaculous' to fetch
>>>> prototype - or am I not seeing something? :)
>>>>
>>>> I already had a look at the 'tapestry.scriptaculous' and
>>>> 'tapestry.scriptaculous.path' configuration variable and it seems it only
>>>> works for resources out of a JAR - when I played with it somewhere in the
>>>> stacktrace it said LocalAsset or something similar...
>>>> --
>>>> View this message in context: http://tapestry.1045711.n5.nabble.com/Fetch-Prototype-library-via-Google-DNS-tp3212754p3213334.html
>>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Howard M. Lewis Ship
>>>
>>> Creator of Apache Tapestry
>>>
>>> The source for Tapestry training, mentoring and support. Contact me to
>>> learn how I can get you up and productive in Tapestry fast!
>>>
>>> (971) 678-5210
>>> http://howardlewisship.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Fetch Prototype library via Google DNS?

Posted by Howard Lewis Ship <hl...@gmail.com>.
On Fri, Oct 15, 2010 at 9:51 AM, Kalle Korhonen
<ka...@gmail.com> wrote:
> On Fri, Oct 15, 2010 at 9:19 AM, Howard Lewis Ship <hl...@gmail.com> wrote:
>> On Fri, Oct 15, 2010 at 1:34 AM, stephanos <st...@gmail.com> wrote:
>>> http://encosia.com/2008/12/10/3-reasons-why-you-should-let-google-host-jquery-for-you/
>>> advantages  obviously are reduced traffic+CPU for the server, decreased
>>> latency, increased parallelism and better caching. How big an advantage it
>>> really is probably depends on how sophisticated Tapestry's bundling is.
>>>
>> The only real advantage to fetching from Google is that the browser
>> may fetch more of the JS files in parallel, since the fetching is
>> across multiple hosts.
>
> And that advantage cannot be discounted for. Almost at 60KB, nothing
> else comes close to the size of the Prototype stack in a typical,
> reasonably designed web application if it's not primarily serving the
> heavy media types. Sure it's cached and all, but a small website
> relies primarily on new users to find the site and that 60KB may be
> enough of a turn off because of general lack of responsiveness.
>
> Using a CDN for loading heavy elements is free from web site's
> perspective and it can be done with Tapestry, but it just makes it
> needlessly difficult to do so.

Patches welcome!

>
> Kalle
>
>
>>> At first I wanted to do it quickly because it seemed to be a quick win - but
>>> the more I struggled with Tapestry to do this, the more it was about just
>>> getting it to do it :)
>>>
>>> There was a
>>> http://tapestry.1045711.n5.nabble.com/Tapestry-Central-Tapestry-5-1-and-IE-8-Customizing-Tapestry-td2436846.html#a2436848
>>> thread  about this topic almost a year ago - with no real solution. The last
>>> entry only says 'U could create a new "URIAssetFactory" to obtain assets
>>> from a
>>> external resource' - but I wouldn't even know where to start. I assumed this
>>> might interest other people too, hence the post here :)
>>>
>>>
>>>> You can configure the Tapestry Scriptaculous Path to get prototype library
>>>> in google.
>>>
>>> Isn't that an oxymoron? Setting the 'tapestry.scriptaculous' to fetch
>>> prototype - or am I not seeing something? :)
>>>
>>> I already had a look at the 'tapestry.scriptaculous' and
>>> 'tapestry.scriptaculous.path' configuration variable and it seems it only
>>> works for resources out of a JAR - when I played with it somewhere in the
>>> stacktrace it said LocalAsset or something similar...
>>> --
>>> View this message in context: http://tapestry.1045711.n5.nabble.com/Fetch-Prototype-library-via-Google-DNS-tp3212754p3213334.html
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>>
>>
>> --
>> Howard M. Lewis Ship
>>
>> Creator of Apache Tapestry
>>
>> The source for Tapestry training, mentoring and support. Contact me to
>> learn how I can get you up and productive in Tapestry fast!
>>
>> (971) 678-5210
>> http://howardlewisship.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Fetch Prototype library via Google DNS?

Posted by Kalle Korhonen <ka...@gmail.com>.
On Fri, Oct 15, 2010 at 9:19 AM, Howard Lewis Ship <hl...@gmail.com> wrote:
> On Fri, Oct 15, 2010 at 1:34 AM, stephanos <st...@gmail.com> wrote:
>> http://encosia.com/2008/12/10/3-reasons-why-you-should-let-google-host-jquery-for-you/
>> advantages  obviously are reduced traffic+CPU for the server, decreased
>> latency, increased parallelism and better caching. How big an advantage it
>> really is probably depends on how sophisticated Tapestry's bundling is.
>>
> The only real advantage to fetching from Google is that the browser
> may fetch more of the JS files in parallel, since the fetching is
> across multiple hosts.

And that advantage cannot be discounted for. Almost at 60KB, nothing
else comes close to the size of the Prototype stack in a typical,
reasonably designed web application if it's not primarily serving the
heavy media types. Sure it's cached and all, but a small website
relies primarily on new users to find the site and that 60KB may be
enough of a turn off because of general lack of responsiveness.

Using a CDN for loading heavy elements is free from web site's
perspective and it can be done with Tapestry, but it just makes it
needlessly difficult to do so.

Kalle


>> At first I wanted to do it quickly because it seemed to be a quick win - but
>> the more I struggled with Tapestry to do this, the more it was about just
>> getting it to do it :)
>>
>> There was a
>> http://tapestry.1045711.n5.nabble.com/Tapestry-Central-Tapestry-5-1-and-IE-8-Customizing-Tapestry-td2436846.html#a2436848
>> thread  about this topic almost a year ago - with no real solution. The last
>> entry only says 'U could create a new "URIAssetFactory" to obtain assets
>> from a
>> external resource' - but I wouldn't even know where to start. I assumed this
>> might interest other people too, hence the post here :)
>>
>>
>>> You can configure the Tapestry Scriptaculous Path to get prototype library
>>> in google.
>>
>> Isn't that an oxymoron? Setting the 'tapestry.scriptaculous' to fetch
>> prototype - or am I not seeing something? :)
>>
>> I already had a look at the 'tapestry.scriptaculous' and
>> 'tapestry.scriptaculous.path' configuration variable and it seems it only
>> works for resources out of a JAR - when I played with it somewhere in the
>> stacktrace it said LocalAsset or something similar...
>> --
>> View this message in context: http://tapestry.1045711.n5.nabble.com/Fetch-Prototype-library-via-Google-DNS-tp3212754p3213334.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Fetch Prototype library via Google DNS?

Posted by Howard Lewis Ship <hl...@gmail.com>.
On Fri, Oct 15, 2010 at 1:34 AM, stephanos <st...@gmail.com> wrote:
>
>> Why do you want this?
>
> Well the
> http://encosia.com/2008/12/10/3-reasons-why-you-should-let-google-host-jquery-for-you/
> advantages  obviously are reduced traffic+CPU for the server, decreased
> latency, increased parallelism and better caching. How big an advantage it
> really is probably depends on how sophisticated Tapestry's bundling is.
>

That article doesn't take into account the things that Tapestry does for you:
- Combines prototype.js with other JS files to form a single JS file
(this is done on-the-fly)
- GZIp compression of the virtual asset
- Far future expires header for the virtual asset
- A couple of bug fixes in the Tapestry version

... and, perhaps in 5.3, on-the-fly minimization of the virtual asset.

The only real advantage to fetching from Google is that the browser
may fetch more of the JS files in parallel, since the fetching is
across multiple hosts.



> At first I wanted to do it quickly because it seemed to be a quick win - but
> the more I struggled with Tapestry to do this, the more it was about just
> getting it to do it :)
>
> There was a
> http://tapestry.1045711.n5.nabble.com/Tapestry-Central-Tapestry-5-1-and-IE-8-Customizing-Tapestry-td2436846.html#a2436848
> thread  about this topic almost a year ago - with no real solution. The last
> entry only says 'U could create a new "URIAssetFactory" to obtain assets
> from a
> external resource' - but I wouldn't even know where to start. I assumed this
> might interest other people too, hence the post here :)
>
>
>> You can configure the Tapestry Scriptaculous Path to get prototype library
>> in google.
>
> Isn't that an oxymoron? Setting the 'tapestry.scriptaculous' to fetch
> prototype - or am I not seeing something? :)
>
> I already had a look at the 'tapestry.scriptaculous' and
> 'tapestry.scriptaculous.path' configuration variable and it seems it only
> works for resources out of a JAR - when I played with it somewhere in the
> stacktrace it said LocalAsset or something similar...
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Fetch-Prototype-library-via-Google-DNS-tp3212754p3213334.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Fetch Prototype library via Google DNS?

Posted by stephanos <st...@gmail.com>.
> Why do you want this? 

Well the 
http://encosia.com/2008/12/10/3-reasons-why-you-should-let-google-host-jquery-for-you/
advantages  obviously are reduced traffic+CPU for the server, decreased
latency, increased parallelism and better caching. How big an advantage it
really is probably depends on how sophisticated Tapestry's bundling is.

At first I wanted to do it quickly because it seemed to be a quick win - but
the more I struggled with Tapestry to do this, the more it was about just
getting it to do it :)

There was a 
http://tapestry.1045711.n5.nabble.com/Tapestry-Central-Tapestry-5-1-and-IE-8-Customizing-Tapestry-td2436846.html#a2436848
thread  about this topic almost a year ago - with no real solution. The last
entry only says 'U could create a new "URIAssetFactory" to obtain assets
from a 
external resource' - but I wouldn't even know where to start. I assumed this
might interest other people too, hence the post here :)


> You can configure the Tapestry Scriptaculous Path to get prototype library
> in google. 

Isn't that an oxymoron? Setting the 'tapestry.scriptaculous' to fetch
prototype - or am I not seeing something? :)

I already had a look at the 'tapestry.scriptaculous' and
'tapestry.scriptaculous.path' configuration variable and it seems it only
works for resources out of a JAR - when I played with it somewhere in the
stacktrace it said LocalAsset or something similar...
-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/Fetch-Prototype-library-via-Google-DNS-tp3212754p3213334.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Fetch Prototype library via Google DNS?

Posted by Howard Lewis Ship <hl...@gmail.com>.
Why do you want this?

In a production application, Prototype will be bundled with the
necessary Scriptaculous and Tapestry libraries into a single "virtual"
asset.

On Thu, Oct 14, 2010 at 1:05 PM, stephanos <st...@gmail.com> wrote:
>
> How can I configure Tapestry to fetch the Javascript Prototype library from
> the  http://code.google.com/apis/libraries/devguide.html#prototype Google
> DNS server ?
>
> Cheers!
> Stephan
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/Fetch-Prototype-library-via-Google-DNS-tp3212754p3212754.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org