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

[Solved] How best to implement caching on Telerick javascript

3 Answers 224 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Steve Bywaters
Top achievements
Rank 1
Steve Bywaters asked on 27 Oct 2009, 01:00 AM
I have been doing a bit of Fiddler-ing.... looking at performance profiling.

One thing that Fiddler keeps pointing out to me is that my pages are apparently doing repeated loads of large chunks of Javascript (100kB+), which I assume is the Telerik js for such items as Ajax, etc, etc.

I further note that these items are NOT cached (according to Fiddler)

So, what's the best policy here?
My sites are always database sites, so I am very cautious about using too much static *page* caching - but there is obviously a big opportunity to speed up those page components which are separately loaded.

Any hints?

Also, is compression useable here?
Can I get any success/war stories on this, too?

(Basically, my theme is "give me more speed!" <g>)

TIA
Steve

3 Answers, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 29 Oct 2009, 07:35 AM
Hi Steve,

This side effect might be related to WebResource caching - when your website is in debug mode (<compilation debug="true" /> in web.config) files streamed by WebResource.axd are not cached by the browser.

Here is a nice blog post on that matter:
http://ocegtech.blogspot.com/2006/06/aspnet-20-webresourceaxd-and-browser.html

In a word everything should be OK once the site is not in debug mode (<compilation debug="false" />).

In addition, you can take a look at this article for other useful resources on the matter.

Kind regards,
Paul
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Steve Bywaters
Top achievements
Rank 1
answered on 30 Oct 2009, 01:19 AM
That's very interesting! As in the blog, my site is indeed running in Debug mode too.
When I get a chance, I'll turn that off, and see how we go with Fiddler again - hopefully I can get to that next week....

BTW I also posted this question as a supprt ticket, and got a response on a different tack - would you think this is still relevant, given what you've pointed out?


Hi Steve,

By default RadScriptManager combines the embedded javascript files into one big file and compresses it. This happens for every page where the RadScriptManager is used and is not always the best solution. We have some ideas on how to give you better control on what gets combined, but for the moment you'll have to do this manually.
Here is a
little tool that will help you with this task.
In the attached web site you'll find a ScriptResourceDetector.aspx page. Place all of the controls that you use on your site in the panel on the page. Upon loading this page you'll see a list of the scripts used on the page that you should directly paste in the Scripts section of the RadScriptManager.

Ideally, RadScriptManager will be placed in a master page, so you don't have to replicate this list across all pages. It'll then serve the same script on all of them, as long as the pages use a subset of the controls that you've used to build the list of scripts.

This way that big script will be loaded only once and then its cached version will be used.

Best wishes,
Veselin Vasilev
the Telerik team

0
Steve Bywaters
Top achievements
Rank 1
answered on 31 Oct 2009, 04:49 AM
I confirm that my sites with debug OFF do indeed cache the WebResources correctly - see the attached pic for a Fiddler dump to demonstrate (lines 106 to 109).

A couple of quick questions further, on that Fiddler dump:
  1. What are the repeated CONNECT sendem.com:443 items? Presumably something to do with the secure HTTP?
  2. How can individual images or other page components be cached? Apparently they aren't being cached at the moment (e.g. lines 125 to 128)

Steve
Tags
General Discussions
Asked by
Steve Bywaters
Top achievements
Rank 1
Answers by
Paul
Telerik team
Steve Bywaters
Top achievements
Rank 1
Share this question
or