[CLOSED] Output Cache issue with Direct Method / Direct Event

Page 2 of 2 FirstFirst 12
  1. #11
    Quote Originally Posted by amitpareek View Post
    Can u test it in chrome frame?
    I apologise. It was a long day yesterday.
    Geoffrey McGill
    Founder
  2. #12
    No Prob Geoff... The issue can be marked solved as soon as you add a property somewhere for disablePostCache. Or rather update the code to not cache both post and get.

    Trying to override Ext.data.Connection.request.

    Its been really long we are trying to find a solution for this and finally it looks near :)
  3. #13
    Hi,

    Please update from SVN. Now POST ajax requests (DirectEvent/DirectMethod) with cache buster by default under Chrome Frame
    Also we added DisableCaching and DisableCachingParam properties for overriding for particular direct event/method. On the global level you can do it via javascript
    Ext.net.DirectEvent.disableCaching 
    Ext.net.DirectEvent.disableCachingParam
  4. #14
    Hi Vlad,
    I would like to get to your notice that, its important this setting remains same for all browsers.

    Reason being, in my tests, on pageload, GET request is cached, however, on subsequent post request, the cache is invalidated and then if you again request the page, its not loaded from cache but from the server.

    In tht case, caching will work only in Chrome Frame and not in other browsers. I request you to make this default in other browsers.

    I am still using an older version of Ext.Net, and at this stage cannot update from SVN. I am looking at overriding the Ext.net.DirectEvent.request method, but having some issue.
  5. #15
    Can you plz check the attached file and tell me if its correct?

    I have tested, and its working perfectly. Just wanted ensure I have not missed anything.

    Thanks,
    Attached Files
  6. #16
    Hi,

    Ok, now POST ajax requests with cache buster by default for all browsers.

    You can use following code to accomplish that
    Ext.net.DirectEvent.on("beforerequest", function(conn, o){
            var method = o.method || this.method || ((o.params || o.xmlData || o.jsonData || o.form) ? "POST" : "GET"),
                url = o.url || this.url,
                form = Ext.getDom(o.form);
                
            if(form){
                url = url || form.action;            
            }
            
            if(method === "POST" && (this.disableCaching && o.disableCaching !== false)){
                if (Ext.isFunction(url)) {
                    url = url.call(o.scope || "window", o);
                }
                var dcp = o.disableCachingParam || this.disableCachingParam;
                o.url = Ext.urlAppend(url, dcp + '=' + (new Date().getTime()));
            }
    }, Ext.net.DirectEvent);
  7. #17
    You can ignore my last post....
    All's well here!

    Thank you so much!
  8. #18

    I Found this. Sorta Related.

    http://www.superstarcoders.com/blogs...post-back.aspx

    Which turns off caching on all non-GET operations, so POST will not be fed from the cache ever.
  9. #19
    Hi michaeld,
    Thanks for your reply, but this issue was sorted long back. Almost 2.5 yrs back :)
Page 2 of 2 FirstFirst 12

Similar Threads

  1. RowDblClick Direct Event Issue
    By sumesh in forum 1.x Help
    Replies: 5
    Last Post: May 01, 2012, 11:15 AM
  2. Direct method and direct event over SSL?
    By dimitar in forum 1.x Help
    Replies: 0
    Last Post: Oct 08, 2011, 8:09 PM
  3. Replies: 7
    Last Post: Jun 28, 2011, 11:13 AM
  4. Replies: 1
    Last Post: Mar 11, 2011, 2:54 PM
  5. Replies: 8
    Last Post: Jun 24, 2010, 9:39 PM

Tags for this Thread

Posting Permissions