When the ig.Loader executes to load script required by a page, it seems to make several trips to the server, even if a component has already been loaded, returning code 304. However, even though there is no need to actually download the code, it seems to consume significant time making multiple trips to the server. For a given browser session, can we issue the ig.loader function once to load all components that will be needed, then omit the function in subsequent pages? Will those pages first attempt to use whatever has been cached by the initial call to ig.loader to load scripts/css? What is the best way to use ig.Loader to limit trips to the server to download script, even if the component scripts have already been loaded?
Hello,
We have a topic on How to use the igLoader.
Also make sure you are not referencing the components explicitly. And you can also send a sample, so we can review what you're experiencing.
Keep in mind that for best performance you can download the minified files with the widgets you want from here.
Thank you for your response. I reviewed the topic How to use the igLoader again (did that when initially configuring for it), but it didn't provide the needed answers. What I would like is to avoid the 304 responses entirely. The following describes what I would like to do.
On the initial page for my app I would like to include the following to get all resource required for the igGrid (assuming a simple grid that isn't using any features).
$.ig.loader({ scriptPath: 'http://localhost/igniteui/js/', cssPath: 'http://localhost/igniteui/css/', resources: 'igGrid' }});
On subsequent pages I want to use the igGrid, but I want to use cached resources. If I issue the above code on this second page I just get the 304 response. However, since I know that I obtained the resources when the first page was executed, there should be no need to attempt to get resources at all. So I just want to execute the following so the page knows where the Infragistics script/css is located. However, when I execute any code on this page that uses the igGrid I get the error "Uncaught TypeError: $(...).igGrid is not a function". It doesn't appear that cached resources are being used. Since I know that the first page of my app has already obtained and cached the needed igGrid resources, my goal is to avoid requesting the igGrid resource at all on subsequent pages of my app, thus avoiding a trip to the server that does nothing but return the 304 response but doesn't download any additional resources.
$.ig.loader({ scriptPath: 'http://localhost/igniteui/js/', cssPath: 'http://localhost/igniteui/css/' }});