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

Page 1 of 2 12 LastLast
  1. #1

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

    Hi,
    We are having issue implementing output cache with Direct Event(DE) / Direct Method(DM).

    Check this URL http://64.34.225.139:222/testing/cache.aspx

    Try this URL in IE with Chrome Frame. Let the page load completely. You will see a message "Ajax Call Complete" and then hit refresh. You will see script block returned by DM.

    This is due to XHR request sent to top level url which invalidates the previous cache and on subsequent reload, loads the last response from server.

    In other browsers Chrome or FF, we dont see the script block but instead Actual page. The interesting point here is, the page does'nt load from cache in other browsers too, instead it loads from the server again. This is because other browsers especially Chrome sends the request with if modified cache control header. And hence the reload. The resources may come from cache, but the actual page comes from server.

    If you remove DM from the page, you will notice that, every subsequent request is loading from cache. You can try this with a simple Aspx page with a DM. I dont think you need a test page here. If u do lemme know, but I think its a pretty simple example.

    One thing I can think of here is to send a random number in a param(not extraparams but querystring param) with every request of DE/DM. Page can be set to cache with VaryByParam.

    We registered this as bug at chromium http://code.google.com/p/chromium/is...etail?id=55918 but in the end the process ended up not being a bug but a browser dependent feature.

    Lemme know how to go about with this. With the size of our application, its important for us to implement Output Cache. I have extensively used DM & DE and cant step back on it now.

    Thanks,
    Last edited by Daniil; Sep 30, 2010 at 8:54 AM. Reason: [CLOSED]
  2. #2
    Can you explain again what we should be testing for here? I tested your sample page in IE, Chrome and Firefox and it appears to load correctly in each.
    Geoffrey McGill
    Founder & CEO
  3. #3
    Quote Originally Posted by geoffrey.mcgill View Post
    Can you explain again what we should be testing for here? I tested your sample page in IE, Chrome and Firefox and it appears to load correctly in each.
    Can u test it in chrome frame?
  4. #4
    Hi,

    I reproduced the issue on IE8 with Chrome Frame using the link that you provided.

    But I can't reproduce with my code.

    Could you provide us with the .aspx?
  5. #5
    Hi,

    Well, I am sure that it is Chrome Frame bug because POST requests should not be chached
    As understood the problem occurs because the server returns cache directive for DirectMethod.

    There is disableCaching option for Ext.Ajax but it is used for GET requests only
    disableCaching : Boolean
    True to add a unique cache-buster param to GET requests. (defaults to true)
    You can play with 'request' method (override 'request' method of Ext.data.Connection)
    Ext.data.Connection.override({
        request : function(o){ 
                .....
                if(/*method === GET && */(me.disableCaching && o.disableCaching !== false) || o.disableCaching === true){
                      var dcp = o.disableCachingParam || me.disableCachingParam;
                      url = Ext.urlAppend(url, dcp + '=' + (new Date().getTime()));
                }
                .....
        }
    });
    Vladimir Shcheglov
    Sr. Developer
  6. #6
    Hi Vlad,
    I will check tht code.

    Can you check the following link and check the last comment of Ananta? (Just before my comment)

    http://code.google.com/p/chromium/is...etail?id=55918

    As for caching, In Chrome and FF, post requests are not cached, but at the same time, since the call is made to the same url, the subsequent get request does'nt come from cache but from the server. If I dont use DM or DE, the page is served from Cache.

    To fix the problem for Chrome Frame, I returned NoStore for cache for all DM and DE. It worked. But then subsequent request is fetched from servr and not cache.

    Thanks,
  7. #7
    Hi Vlad,
    In the URL property of a Direct Event, I added a param to the URL like this: default.aspx?dm=1101010.

    It seemed to have worked perfectly as the URL changes.

    Can we have the following 2 Properties for DirectEvent & DirectMethod for cache busting:
    DisableCaching
    CachingParam

    We can also have this as a config option in web.config.
  8. #8
    Hi,

    As I mentioned before ExtJS adds cache buster for GET requests only.
    I will investigate the possibility to add cache buster for POST requests undr Chrome and Chrome Frame
    Vladimir Shcheglov
    Sr. Developer
  9. #9
    Or mite as well just a property DisablePostCache which can be by default false.
  10. #10
    Hi Vlad,
    Thanks!
    I can confirm that its working with cache bust for post. So just adding the said property would be enuf, irrespective of browser.

    Thanks,
Page 1 of 2 12 LastLast

Similar Threads

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

Tags for this Thread

Posting Permissions