Javascript issues (4.0.1210.0)
Because I'm nearing completion on one of my projects I thought and run it through YSlow and PageSpeed...
First point I'm hitting is 'minify Javascript'. As it turns out, webresouce and scriptresource aren't minified.
Looking a bit further, I came across this one...
// Name: Telerik.Sitefinity.Resources.Scripts.MicrosoftAjax.debug.js // Assembly: Telerik.Sitefinity.Resources // Version: 4.0.1210.0 // FileVersion: 4.0.1210.0
Hello Jochem,
Please make sure that your website is not set to run in debug mode (this is configured from web.config):
<
compilation
debug
=
"false"
targetFramework
=
"4.0"
>
@Radoslav
Are you checking the same build (4.0.1210.0) as me?
I'm definately seeing 2x jQuery loading from ScriptResource.axd, one time v1.4.2 and one time v1.4.3. The only 'widget' loaded on the page is a menu, a standard search box and several (textual) content blocks.
I know I can be blond sometimes, but I actually did check to see if I had compilation debug set to false.
Thanks for telling me the CDN settings though, hadn't spotted them yet.
Any way I can show you that v1.4.2 and v1.4.3 are loaded? A screenshot won't really work...
Jochem.
Hi Jochem,
I am using the version of Sitefinity you have specified in your original post, so yes we are working with the same version. I see what I was missing before. The thing is the Navigation control - it uses RadControls for ASP.NET Ajax which use jQuery for their client side functionality. It loads a different version of jQuery and when it loads it it transfers it to $telerik:
// Move jQuery to $telerik
$telerik.$ = jQuery.noConflict(
true
);
@Radoslav,
I just finished a clean set-up / test case scenario. Look at the attached image.
To the left you see a standard page with navigation control on a custom masterpage. To the right you see that same page run with an 'integrated' masterpage.
The 'custom' masterpage is totally empty except for placeholders, also no codebehind code or anything and yet instead of 6 requests it's hitting 20 requests (including the double jquery and the ajax.debug.js). I even emptied it further out to 1 placeholder but still it's hitting 20 requests....
*lol* Is this punishment for not being modern and sticking to custom masterpages or am I missing something?
(... 20mins further...)
Well I think I've found what's causing the mayhem, perhaps you can confirm but if I remove the <asp:scriptmanager> tag from the custom masterpage, everything seems to go normal and we're hitting those 6 requests instead of 20.
Jochem.
-- follow up --
With scriptmanager in custom masterpage:
20 requests.
301.K download
Loading of jQuery v1.4.2 AND v1.4.3
Loading of MicrosoftAjax.js AND MicrosoftAjax.debug.js
Hello Jochem,
I am testing with our latest build that will be released as 4.1 (Q1 release). The debug=false" setting works as expected. When you use it, minified versions of the scripts are loaded. This should also apply to Sitefinity scripts from 4.1 (previously did not).
There is still two instances of jQuery loaded - one from Sitefinity and one from RadControls, as Radoslav mentioned. We still do not have solution to this.
What's worth noting:
When you use a ScriptManager in your master page, it does not handle the script combining logic. Internally, if no other ScriptManager is found, we include a RadScriptManager and set its combining to true or false based on a configuration setting. By default combining is on, so it should load just a few scripts from the server. In the case I am testing, only two scripts are loaded, one of them is the combined script. If I turn off script combining I get around 7 scripts loaded. This is on a page with a navigation + a content block (similar to your screenshot).
Also note, that the count of the loaded scripts depend on whether you use inline editing. If it is on, more scripts are loaded because they are required. To test without inline editing, open the page in a browser where you are not logged in Sitefinity.
@Lyubomir
Me is smiling!
Lyubomir
Has a solution to this ever been found? I'm also seeing two versions of the JQuery file in SF 4.4.2117.
From a performance point of view this is just not feasible. Customers are getting to the point where they want to squeeze every bit of performance out of their websites and have double requests for the same library just isn't professional at all.
Lyubomir
Has a solution to this ever been found? I'm also seeing two versions of the JQuery file in SF 4.4.2117.
From a performance point of view this is just not feasible. Customers are getting to the point where they want to squeeze every bit of performance out of their websites and have double requests for the same library just isn't professional at all.
@J
Are all of the built-in widgets "RadControls"?
@Dan,
The Navigation widget (menu/tabstrip/panelbar etc). The RadEditor (comments / forums). And I believe the Social sharing (not the widgets but the options introduced within news/blogs). All these are based on the standard RadControls Telerik offers.
Under Administration >> Advanced >> Toolboxes >> Toolboxes >> PageControls >> Sections >> RadControls they provide all the 'standard' RadControls as well as widgets, but by default this widget section is disabled.
Since 'navigation' is a pretty standard thing to implement on a website :), it's kind of an issue for people wanting a lean and fast loading site...
---
If you're interested in the latest rant on Javascript loading and optimization you might want to check this post (based on Sitefinity v4.4) - haven't had time yet to do my quarterly update on v5 yet...
Jochem.