This is a migrated thread and some comments may be shown as answers.

Embedded script. Problem with performance.

5 Answers 100 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Roman
Top achievements
Rank 1
Roman asked on 12 Jul 2011, 10:08 AM
Hello.
I have a problem with caching embedded script.
So each time when request is being proccessed, WebResource.axd generated and did not take from cache.
I have several RadWindows and each time I open them embedded script is generated. How can i make static link to embedded script(not Telerik.Web.UI.WebResource.axd) that browser could cache it?

5 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 13 Jul 2011, 09:30 AM
Hi Roman,

If there has not been a postback in the page (i.e. you open the RadWindows via JavaScript, which is the best way) the scripts will be loaded only for the first one.

Nevertheless there is a way to disable the embedded scripts and reference them from actual js files and not from a webresource, so that a browser may cache them. How to do this is explained in the following help article: http://www.telerik.com/help/aspnet-ajax/introduction-disabling-embedded-resources.html. Another, similar approach is to use our CDN servide: http://www.telerik.com/help/aspnet-ajax/radscriptmanager-cdn-support.html.


Best wishes,
Marin
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Roman
Top achievements
Rank 1
answered on 22 Jul 2011, 11:23 AM
Hi Marin.
I'm using Javascript for opening RadWindow.

In your demo page: http://demos.telerik.com/aspnet-ajax/window/examples/dialogreturnvalue/defaultcs.aspx you have a few pages and each time page is loaded WebResource.axd is being generated.

How can we reduce size of this script or avoid generation each time ?
0
Marin Bratanov
Telerik team
answered on 22 Jul 2011, 04:30 PM
Hello Roman,

The resources you see loaded every time are for the page, loeaded within the RadWindow, as it is loaded anew every time due to the ReloadOnShow property being set to true.

The RadWindow's scripts are not loaded every time it is shown if it is shown via JavaScript and the page has not been disposed in the meantime.

The suggestions from my previous post show how to externalize the JavaScript files so that the browser may cache them (or it may not, this depends on settings on the server, as well as settings on the client's browser).

If you further want to minimize these requests you may examine the RadCompression module or other server-side methods of compressing the script. You could start from this google search.


Regards,
Marin
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Roman
Top achievements
Rank 1
answered on 25 Jul 2011, 11:45 AM
Hi Marin.
We have 20 different pages. Telerik script and CSS URLs are NOT the same on different pages. Can we hardcode ONE static URL which would suite ALL 20 pages?
0
Marin Bratanov
Telerik team
answered on 26 Jul 2011, 04:12 PM
Hi Roman,

This is generally not possible with a WebResource and this is why I recommended the Telerik CDN or externalizing the scripts. You could put a ScriptManager with the needed references in a master page which can be inherited throughout the project. You can also externalize the skins in a similar manner. You can examine the following help articles for more information on externalizing skins and for general performance optimizations:
http://www.telerik.com/help/aspnet-ajax/introduction-skins-external-assembly.html
http://www.telerik.com/help/aspnet-ajax/introduction-optimizing-output-page-load-time-using-radscriptmanager-radstylesheetmanager.html



Greetings,
Marin
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
General Discussions
Asked by
Roman
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Roman
Top achievements
Rank 1
Share this question
or