1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    46
    Vote Rating
    0
    valc is on a distinguished road

      0  

    Default Caching issue ?

    Caching issue ?


    Some backend changes that I have made do not appear in IE until I close the browser and restart. This does not happen in Firefox 2.0? Is it my IE settings or the Yahoo.ext.

    I am using the following code...

    var sections= getEl('sections');
    sections.load(url, null,function())

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Code:
    if (YAHOO.ext.util.Browser.isIE) {
        YAHOO.ext.UpdateManager.defaults.disableCaching = true;
    }

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    or

    Code:
     sections.load({url:url, nocache:true}, null,function());

  4. #4
    Ext User
    Join Date
    Mar 2007
    Posts
    46
    Vote Rating
    0
    valc is on a distinguished road

      0  

    Default


    Thanks Animal. Will that code suffice for DataModel loading too ?

  5. #5
    Ext User
    Join Date
    Mar 2007
    Posts
    46
    Vote Rating
    0
    valc is on a distinguished road

      0  

    Default


    Is there a similar way to stop caching for the YAHOO.ext.grid.LoadableDataModel ?

    YAHOO.ext.grid.myXMLDataModel.prototype.loadPage = function(pageNum, callback, keepExisting){
    var start = (pNum-1) * this.pageSize;
    start = start < 1 ? 1 : start;
    var params = "&Start="+start;

    this.load(this.pageUrl, params, this.setLoadedPage.createDelegate(this, [pageNum, callback]),
    keepExisting ? start : true);
    };

    I tried to use this.load({url:this.pageUrl, nocache:true} but the refresh indicator hangs(keeps spinning) in IE when I refresh the view.

  6. #6
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    For a LoadableDataModel you could use

    Code:
    myDataModel.load(url, {cacheBuster:new Date()});
    Or, set it up when you initialize the paging:

    Code:
    myDataModel.initPaging(url, 10, {cacheBuster:function(){return new Date()});

  7. #7
    Ext User
    Join Date
    Mar 2007
    Posts
    46
    Vote Rating
    0
    valc is on a distinguished road

      0  

    Default


    Thanks Animal, that worked a treat. I have one last issue. The following line in yui.ext.js (lastest rel.) is giving me an error in IE but is ok in Firefox.

    The last part is throwing the error eval(match[1])

    var id=YAHOO.util.Dom.generateId();var dom=this.dom;html+='<span id="'+id+'"></span>';YAHOO.util.Event.onAvailable(id,function(){var hd=document.getElementsByTagName("head")[0];var re=/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/img;var srcRe=/\ssrc=([\'\"])(.*?)\1/i;var match;while(match=re.exec(html)){var srcMatch=match[0].match(srcRe);if(srcMatch&&srcMatch[2]){var s=document.createElement("script");s.src=srcMatch[2];hd.appendChild(s);}else if(match[1]&&match[1].length>0){eval(match[1]);}}

    When I have loadScripts enabled on a dynamically loaded page and and I have a <script> at the bottom of the page it throws a syntax error. Any ideas ? See <script> code...

    <script type="text/javascript">//<![CDATA[
    var hd = YAHOO.util.Dom.getElementsByClassName('dl-group-hd')
    var bd = YAHOO.util.Dom.getElementsByClassName('dl-group-bd')
    for (var i = 0; i< hd.length; i++){
    var nav = new Nav(hd[i],bd[i]);
    nav.expand();
    }
    //]]></script>

  8. #8
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    4
    tryanDLS is on a distinguished road

      0  

    Default


    It might be the comment tags you're wrapping around the JS code - I think there's a post on this someplace - haven't found it yet.

  9. #9
    Ext User
    Join Date
    Mar 2007
    Posts
    46
    Vote Rating
    0
    valc is on a distinguished road

      0  

    Default


    It happens without the comment tags too.

    This post ?
    http://www.yui-ext.com/forum/viewtop...dscripts+error

  10. #10
    Ext User
    Join Date
    Mar 2007
    Posts
    46
    Vote Rating
    0
    valc is on a distinguished road

      0  

    Default


    I moved the script code as I couldn't figure out why it was failing in IE. Thanks anyway.

    Cheers,

    Val.

Similar Threads

  1. Caching YUI/EXT (SSL)
    By Atis in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 11 Mar 2007, 2:15 PM
  2. Paging Grid issue: pagetoolbar is a issue
    By wwwlinux in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 28 Feb 2007, 5:48 PM
  3. Unknown issue
    By jcnorman in forum Ext 1.x: Bugs
    Replies: 2
    Last Post: 23 Feb 2007, 12:27 PM
  4. DateEditor issue
    By mangesh in forum Ext 1.x: Bugs
    Replies: 1
    Last Post: 20 Feb 2007, 8:51 AM
  5. Sprites caching
    By alexb in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 9 Nov 2006, 1:55 AM

Thread Participants: 2