2009/7/20 Alex McAuley <webmas...@thecarmarketplace.com>:
>
> I can share most of it though the minifier i wrote is not available as its
> part of a package someone paid me to develop....
>
> I can certainly give you the concepts of what needs doing and i am sure you
> can work out the code.
>
> I'll make a pastie of everything that should be done and put the link up
> when its finished
>
> Alex
>
> ----- Original Message -----
> From: "Richard Quadling" <rquadl...@googlemail.com>
> To: <prototype-scriptaculous@googlegroups.com>
> Sent: Monday, July 20, 2009 4:09 PM
> Subject: [Proto-Scripty] Re: Checking if prototype is loaded
>
>
>>
>> 2009/7/20 Alex McAuley <webmas...@thecarmarketplace.com>:
>>>
>>> The technique i developed is about 5 times faster than the one in the
>>> link
>>> you provided and alot less server load!.......
>>>
>>> However back in 2006 it was good insight from razaak to achieve it that
>>> way..
>>>
>>> Thanks for the info.
>>>
>>> Alex
>>> ----- Original Message -----
>>> From: "Richard Quadling" <rquadl...@googlemail.com>
>>> To: <prototype-scriptaculous@googlegroups.com>
>>> Sent: Monday, July 20, 2009 3:22 PM
>>> Subject: [Proto-Scripty] Re: Checking if prototype is loaded
>>>
>>>
>>>>
>>>> 2009/7/20 Alex McAuley <webmas...@thecarmarketplace.com>:
>>>>>
>>>>> With a script that gathers everything first, minifies, checks for gzip
>>>>> handling and outputs the appropriate response! ... same with CSS.
>>>>>
>>>>> When i started looking into speeding pages up using the google "page
>>>>> speed"
>>>>> add on for firefox i had 7 red x's .... now i have 100% green ticks!
>>>>> which
>>>>> is thanks to a few hacks i worked out but mainly due to downloading
>>>>> everything the page needs in one hit rather than paralell or lazy
>>>>> loading!... couple that with caching and you have a lightning web app.
>>>>>
>>>>>
>>>>>
>>>>> ----- Original Message -----
>>>>> From: "Richard Quadling" <rquadl...@googlemail.com>
>>>>> To: <prototype-scriptaculous@googlegroups.com>
>>>>> Sent: Monday, July 20, 2009 2:29 PM
>>>>> Subject: [Proto-Scripty] Re: Checking if prototype is loaded
>>>>>
>>>>>
>>>>>>
>>>>>> 2009/7/20 Alex McAuley <webmas...@thecarmarketplace.com>:
>>>>>>>
>>>>>>> Yer i dont load it via src="" as it slows the page down
>>>>>>> dramatically!!!
>>>>>>> ....
>>>>>>>
>>>>>>> Contrary to popular belief i have tried and tested external scripts
>>>>>>> and
>>>>>>> external css files and due to browsers paralell downloads with YSlow
>>>>>>> i
>>>>>>> can
>>>>>>> save around 7 seconds on loading a very heavy page full of
>>>>>>> prototype,jQuery
>>>>>>> some UI stuff and a bunch of CSS!...
>>>>>>>
>>>>>>> It does seem that it gets evaluated though you are correct, i went
>>>>>>> back
>>>>>>> and
>>>>>>> checked after finding those bits out and watched page load speed
>>>>>>> before
>>>>>>> and
>>>>>>> after!.
>>>>>>>
>>>>>>> Ta
>>>>>>>
>>>>>>> Alex
>>>>>>>
>>>>>>>
>>>>>>> ----- Original Message -----
>>>>>>> From: "Richard Quadling" <rquadl...@googlemail.com>
>>>>>>> To: <prototype-scriptaculous@googlegroups.com>
>>>>>>> Sent: Monday, July 20, 2009 12:23 PM
>>>>>>> Subject: [Proto-Scripty] Re: Checking if prototype is loaded
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> 2009/7/20 Alex McAuley <webmas...@thecarmarketplace.com>:
>>>>>>>>>
>>>>>>>>> Just an FYI incase anyone wondered ....
>>>>>>>>>
>>>>>>>>> It seems (at least in firefox 3x, IE7+, CHrome, Safari (windows))
>>>>>>>>> that
>>>>>>>>> the
>>>>>>>>> browser or "prototype" itself wont load 2 copies of it....
>>>>>>>>>
>>>>>>>>> To Test i included prototype.js in the <head> and included it again
>>>>>>>>> in
>>>>>>>>> the
>>>>>>>>> body and there was only one output of javascript!....
>>>>>>>>>
>>>>>>>>> Kudos to the browser vendors or the script devs!!
>>>>>>>>>
>>>>>>>>> ----- Original Message -----
>>>>>>>>> From: "Alex McAuley" <webmas...@thecarmarketplace.com>
>>>>>>>>> To: <prototype-scriptaculous@googlegroups.com>
>>>>>>>>> Sent: Monday, July 20, 2009 11:12 AM
>>>>>>>>> Subject: [Proto-Scripty] Re: Checking if prototype is loaded
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Sorry my bad.... was "if(window.Prototype) ..."
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Sorry for silly post !!
>>>>>>>>>>
>>>>>>>>>> Alex
>>>>>>>>>> ----- Original Message -----
>>>>>>>>>> From: "Jeztah" <webmas...@thecarmarketplace.com>
>>>>>>>>>> To: "Prototype & script.aculo.us"
>>>>>>>>>> <prototype-scriptaculous@googlegroups.com>
>>>>>>>>>> Sent: Monday, July 20, 2009 11:07 AM
>>>>>>>>>> Subject: [Proto-Scripty] Checking if prototype is loaded
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Morning guys.
>>>>>>>>>>>
>>>>>>>>>>> Does anyone know a way to check if prototype is loaded or not
>>>>>>>>>>> ....
>>>>>>>>>>>
>>>>>>>>>>> I have tried "if(Prototype) { ..." but just throws an undefined
>>>>>>>>>>> error.
>>>>>>>>>>>
>>>>>>>>>>> I know i know i should know if it is loaded or not but my servers
>>>>>>>>>>> use
>>>>>>>>>>> very heavy aggressive caching due to massive user loads and i
>>>>>>>>>>> noticed
>>>>>>>>>>> in my cache there was some javascript thats not even on the page
>>>>>>>>>>> left
>>>>>>>>>>> in a session cache.
>>>>>>>>>>>
>>>>>>>>>>> To cut it short i use server side methods to gzip/minify js files
>>>>>>>>>>> on
>>>>>>>>>>> page load (same with the css).... as they are loaded they go into
>>>>>>>>>>> an
>>>>>>>>>>> array if whats loaded. Then on the page i am able to check the
>>>>>>>>>>> "Cache"
>>>>>>>>>>> of javascript loaded by checking a session array variable. The
>>>>>>>>>>> trouble
>>>>>>>>>>> is .... the session variable is rightly telling me prototype is
>>>>>>>>>>> (included) - but not in the <head> tag so it is not showing up as
>>>>>>>>>>> a
>>>>>>>>>>> loaded script once the page is refreshed!!!....
>>>>>>>>>>>
>>>>>>>>>>> would it be window.Prototype or is there a cleaner method ?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Thanks in advance
>>>>>>>>>>>
>>>>>>>>>>> Alex
>>>>>>>>>>>
>>>>>>>>>>> >
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> >
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> >
>>>>>>>>>
>>>>>>>>
>>>>>>>> I would be careful of your assumptions.
>>>>>>>>
>>>>>>>> The second copy IS loaded. Hopefully from cache.
>>>>>>>>
>>>>>>>> You will notice that the very first line of javascript in
>>>>>>>> prototye.js
>>>>>>>> is
>>>>>>>> ...
>>>>>>>>
>>>>>>>> var Prototype = {
>>>>>>>>
>>>>>>>> So, this will overwrite any pre-existing variable called Prototype.
>>>>>>>>
>>>>>>>> So, the second copy IS executed. As far as I can tell, all of the
>>>>>>>> code
>>>>>>>> in prototype.js can quite happily run twice or more without a
>>>>>>>> problem.
>>>>>>>>
>>>>>>>> I think the issue would come if you had other code loaded between
>>>>>>>> the
>>>>>>>> 2 prototypes which you expected to be present. Say a plugin to
>>>>>>>> prototype....
>>>>>>>>
>>>>>>>> <script type="text/javascript" src="/js/prototype.js"></script>
>>>>>>>> <script type="text/javascript"
>>>>>>>> src="/js/prototype-plugin.js"></script>
>>>>>>>> <script type="text/javascript" src="/js/prototype.js"></script>
>>>>>>>>
>>>>>>>> If the plugin extends prototype's features in some way, then the
>>>>>>>> second load of prototype will effectively reset Prototype back to
>>>>>>>> the
>>>>>>>> base version.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> -----
>>>>>>>> Richard Quadling
>>>>>>>> Zend Certified Engineer :
>>>>>>>> http://zend.com/zce.php?c=ZEND002498&r=213474731
>>>>>>>> "Standing on the shoulders of some very clever giants!"
>>>>>>>> ZOPA : http://uk.zopa.com/member/RQuadling
>>>>>>>>
>>>>>>>> >
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> >
>>>>>>>
>>>>>>
>>>>>> How do you load prototype?
>>>>>>
>>>>>> --
>>>>>> -----
>>>>>> Richard Quadling
>>>>>> Zend Certified Engineer :
>>>>>> http://zend.com/zce.php?c=ZEND002498&r=213474731
>>>>>> "Standing on the shoulders of some very clever giants!"
>>>>>> ZOPA : http://uk.zopa.com/member/RQuadling
>>>>>>
>>>>>> >
>>>>>>
>>>>>
>>>>>
>>>>> >
>>>>>
>>>>
>>>> Ah. I use a slightly modified version of [1] for my js/css compression.
>>>>
>>>> When you said you don't load via src=, I wasn't thinking very cleverly.
>>>>
>>>> I don't use minify, but that would certainly help reduce the load on
>>>> the line for the first hit and for each cache failure.
>>>>
>>>> Regards,
>>>>
>>>> Richard.
>>>>
>>>>
>>>> [1]
>>>> http://rakaz.nl/2006/12/make-your-pages-load-faster-by-combining-and-compressing-javascript-and-css-files.html
>>>>
>>>>
>>>> --
>>>> -----
>>>> Richard Quadling
>>>> Zend Certified Engineer :
>>>> http://zend.com/zce.php?c=ZEND002498&r=213474731
>>>> "Standing on the shoulders of some very clever giants!"
>>>> ZOPA : http://uk.zopa.com/member/RQuadling
>>>>
>>>> >
>>>>
>>>
>>>
>>> >
>>>
>>
>> Any chance of sharing your code?
>>
>> Just to give some support to razaak, prototype being loaded for every
>> single page request was a significant load. In many cases it was the
>> biggest load on a single page.
>>
>> With our intranet and the caching techniques, I can see that it is
>> only ever loaded once per new machine/user combination (we have
>> hot-desking).
>>
>> Richard.
>>
>>
>> --
>> -----
>> Richard Quadling
>> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
>> "Standing on the shoulders of some very clever giants!"
>> ZOPA : http://uk.zopa.com/member/RQuadling
>>
>> >
>>
>
>
> >
>

That'd be great.

Do you have any problem if I share the code I create based upon your notes?

-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"
ZOPA : http://uk.zopa.com/member/RQuadling

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to