My application has been set to cache its resources, but the file ig_WebGrid.xslt is never being cached, and is producing a big overhead. Because is being requested and downloaded several times.
Any idea why this happen?
Hello Rumen,
Yes, actually we ended up implementing one of the options you mention.
What we did was create a script with the following content, that is included at the end in every page:
function igtbl_XSLTProcessor(xsltURL){ if(!xsltURL) return null; if(ig_csom.IsIE) { var xslt=ig_createActiveXFromProgIDs(["MSXML2.FreeThreadedDOMDocument","Microsoft.FreeThreadedXMLDOM"]); xslt.async=false; var http = new ActiveXObject("Msxml2.XMLHTTP.3.0"); http.open("GET", xsltURL, false); http.send(); xslt.loadXML(http.responseText); var xslTemplate=new ActiveXObject("MSXML2.XSLTemplate"); xslTemplate.stylesheet=xslt; this.Processor=xslTemplate.createProcessor(); } else { var xmlResp=new DOMParser(); var xmlHttp=new XMLHttpRequest(); xmlHttp.open("GET",xsltURL,false); xmlHttp.send(null); this.Processor=new XSLTProcessor(); this.Processor.importStylesheet(xmlResp.parseFromString(xmlHttp.responseText,"text/xml")); }}igtbl_XSLTProcessor.prototype.addParameter=function(name,value){ if(!this.Processor) return null; if(ig_csom.IsIE) return this.Processor.addParameter(name,value); else return this.Processor.setParameter(null,name,value);};igtbl_XSLTProcessor.prototype.transform=function(){ if(!this.input) return false; if(ig_csom.IsIE) { this.Processor.input=this.input; this.Processor.transform(); this.output=this.Processor.output; } else return this.outputDocument=this.Processor.transformToDocument(this.input); return true;};
The results are just as before, caching works, so the XSLT is only downloaded once.
Thanks for your response!
Hello Dzyann,
Javascript is a prototype language, so even though the original script comes from embedded resources, if you create a function with the same name (from what I see in Tony's fix) and place it after the original declaration, it will override (replace) the original one. So one of the things to try is to place Tony's javascript fix at the very bottom of your page and see if it works for you.
The second option you have is to switch from using internal assembly resources to external ones, with the fix applied. This should not be that difficult, setting JavaScriptFileName and Path should be enough.
The third option is to contact Developer Support directly, but even if this is entered in our queue, it will get some time before it gets fixed / tested and released in a HotFix.
Hi Tony,
First of all, let me tell you, your previous fix worked like a charm, so thanks again.However, now we are having the same issue in another application that doesn't have the javascript files deployed along with the site, but rather lets the ultrawebgrid use its embedded resources, so we can't apply your fix by changing the JS directly.
Any ideas on how to get around this?
Glad I could help!
Amazing! Thank you very much!
I changed the code you indicated me, and now the cache is working fine (I verified this with fiddler).
That problem was driving me crazy! I should go church and pray for you! You saved my life!
Regards.-