I am trying to clean up an implementaiton of some infragistics controls. For all intents and purposes the site works just fine, and I don't want to overhaul it. It definitely has too many "elements" on it which is causing something like 40 ScriptResources to download. As far as I can tell they aren't caching, and some of the different profiling tools I have been using have been showing some HUGE times. Does anyone have any ideas on how I can try to reduce, or at least cache the, ScriptRefence calls?
First, double-check that your website is not in debug mode. If the <compilation debug="true"/> is set in the web.config, then the browser is instructed to requery the server for every resource on every refresh.
Also, you need to have a look at using the WebScriptManager instead of the asp:ScriptManager. This opens up use of the CDN and also allows you to use the EnableCombining property which allows the scripts to be combined.
Here is the magic link!
http://help.infragistics.com/NetAdvantage/ASPNET/2010.3/CLR4.0/?page=Web_Infragistics_Content_Delivery_Network_CDN.html
If you use the WebScriptManager, then you also have the option of setting the EnableCDN and EnableCombining properties for the entire website using an entry in the web.config.
Just one word of caution on the CDN... I have not been able to use it because I am using some of the legacy controls (the old UltraWebGrid and the old menu control), and some of the images are not on the https:// version of the CDN. But if you are not using legacy controls, then you should be good to go.
Thanks for the reply. I suspect that this solution may fall into the criteria of "old". I inspected the Infragistics.Web.UI namespace in the Infragistics35.Web.v8.3 assembly and I do not see it in there. So I guess that means I am using v 8.3 of the controls. Any thoughts?
By the way, I do have the debug="false" setting correctly set in the web.config. I would also like to post a bit of what I am seeing and why I am going down this route. The solution has 1 web spliter and 4 or 5 tabs wihtin those splits, and then a couple of the tabs have more splitters and tabs in some cases. At first inspection this looks like a heafty amount of controls for a web app, and I do realize that, but I am hoping there is something I can do here to make it better in the short term.
When I load the page in Frefox with Firebug on, looking at the net panel, there are 35 or 40 ScriptManagers kicked offf, each taking in 40,000 - 80,000 or so bytes. The load time on the site is about 5 - 8 seconds depending on the state of the page. Those times are reported by Firebug, and if I do a rough count along with the load, the time for the progress bar to finish is pretty on point So my question is, does this confirm that the scripts aren't caching? Are those sizes really being sent over the wire? And are those times realized because of all of these scripts?
I have drafted my own conclusion on this (hence the post) but I figured I would post it out there to see what your / community thoughts are.
Any info would be helpful.
Thanks!
lol, I had already upgraded... and then noticed the CDN in the documentation. I have renewed my subscription every year since 2003 (I think).. It has been worth every penny.
Ah, I see what you were trying to do. Makes sense. So you had to upgrade to get better performance :)
Hey Michael,
I am glad to report that I now have this working exactly the way I want.
I never wanted the HTML of the page cached... only the resources. I want dynamic HTML to remain dynamic (refreshing on every page load). And nocache is exactly the right setting. But I want all the scripts and images to come from the browser cache.
As far as the "noise", I have fully moved to the CDN, and it has worked wonders. There are fewer Infragistics scripts loaded by the page (due to script combining), and the ones that are required are being retrieved from the browser cache (because the CDN automatically sends the right cache headers). It has had a nice impact on page load times.
I am not sure what to suggest if upgrading to the CDN isn't an option... I can only say that it has worked very well for me.
Cheers,
-Rob
I have tried the script combining technique ... for reason I cannot get this to work. Pretty frustrating. I can imagine that doing so would help in this case. I would rather take a couple of large files as opposed to all of those HTTP requests!
I can see where the caching would be logical, but I am not sure that is entirely what you want. That functionality with cache the actual ASP.NET page. In many infragistics controls fall into this category a lot). That being said, even if you effectively cache your ASP.NET page, the cached content would include the calls (in javascript) to those resources and you will in fact still make calls to get those references.
By the way, if you were looking to cache a page, i think that code is not what you want. NoCache means don't cache this page ... which I am willing to bet is the default for an ASP.NET page. You would want to do something like Server. There are many options though. Please reference MSDN
http://msdn.microsoft.com/en-us/library/w9s3a17d(v=VS.100).aspx
Best of luck. Because I think this post now got buried I posted a new one if you would like to follow along.
http://forums.infragistics.com/forums/p/52280/272153.aspx#272153
I can't reply as an Infragistics "guru" or even a prominent member of the community. Just another programmer working on a Saturday :)
You are right about this being a new feature. I think it came out around 9.3 or 10.1. However, if upgrading from 8.3 is not an option, all is not lost.
Here is a blog that Infragistics wrote about how to accomplish script combining in Infragistics 8.3 using the <asp:ScriptManager/>
http://blogs.infragistics.com/blogs/tony_lombardo/archive/2008/07/28/script-combining-what-s-the-big-deal.aspx
and another (with more detail)
http://community.infragistics.com/aspnet/articles/understanding-script-combining.aspx
On the caching issue, I have a nagging feeling that I am doing it wrong, and I am hoping that somebody can chime in and help. Like you, I want the browser to not cache the HTML, but to cache ScriptResources, js files, and image files. I put the following line in the page's Page_Load event, hoping that the cache instructions would only apply to the actual HTML of the page.
Response.Cache.SetCacheability (HttpCacheability.NoCache)
However, that doesn't seem to be working as intended. Sure the HTML of the page is being requeried, but also Fiddler that shows images, etc, being reloaded on each refresh.
Probably I just have the wrong setting, and the answer to that could well be the answer to your question on caching ScriptResources.