1. #1
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    88
    Vote Rating
    5
    Answers
    3
    whirling dervish is on a distinguished road

      0  

    Default Unanswered: Is there a simple way to disable caching for an entire ExtJS 4 application?

    Unanswered: Is there a simple way to disable caching for an entire ExtJS 4 application?


    As far as I can tell to the extra extjs disable caching parameter, I have to do the following,

    Disable it on the loader,
    Code:
    Ext.Loader.setConfig({
        disableCaching: false
    });
    Disable it on the Ajax singleton,
    Code:
    Ext.Ajax.disableCaching = false;
    And then disable it on every single proxy using noCache = false.

    Is there are simpler way to do all this? Ideally I'd like one thing I could set so I could easily switch between disableCaching mode being on and off.

    Or at there a very least, is there a simple way to change all proxies without touch each proxy?

  2. #2
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    Answers
    21
    vadimv will become famous soon enough vadimv will become famous soon enough

      0  

    Default


    Just my 2 cents, at first look there's no a global config for this, so you may override the proxy by disabling the cache trough that config - which is going to disable to all instantiated proxies in your app.
    Disabling cache for Loader works only at Development, although you may need the opposite since the code you are working on changes very frequently

  3. #3
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    88
    Vote Rating
    5
    Answers
    3
    whirling dervish is on a distinguished road

      0  

    Default


    Hmm I am not seeing switching to ext-all.js (from ext-dev-all.js) disable the no caching param. Is that is what is suppose to happen?

  4. #4
    Sencha Premium Member vadimv's Avatar
    Join Date
    Sep 2010
    Location
    Chisinau, Moldova
    Posts
    642
    Vote Rating
    25
    Answers
    21
    vadimv will become famous soon enough vadimv will become famous soon enough

      -1  

    Default


    Explaining once again regarding Ext.Loader.disableCaching:
    Ext.Loader manages dependency loading of files, when you do developing, For production you use Sencha Cmd which builds the app-all.js with all dependencies within it, and here playing with Ext.Loader.disableCaching is useless, you should comment that piece of code where you config Ext.Loader:

    It's important to note that dynamic loading should only be used during development on your local machines. During production, all dependencies should be combined into one single JavaScript file. Ext.Loader makes the whole process of transitioning from / to between development / maintenance and production as easy as possible. Internally Ext.Loader.history maintains the list of all dependencies your application needs in the exact loading sequence. It's as simple as concatenating all files in this array into one, then include it on top of your application.

    So should be sth like this:
    Code:
    /*Ext.Loader.setConfig({
          enabled:true,
          disableCaching: true
    
    
     });
    */
    Ext.data.Connection.disableCaching = false;
    Ext.data.proxy.Server.prototype.noCache = false;
    Ext.Ajax.disableCaching = false;
    
    
    Ext.application({
        
        controllers: ["Main"],
        
        name: 'App',
    
    
        autoCreateViewport: true
    });
    Read better the docs
    http://docs.sencha.com/ext-js/4-1/#!/api/Ext.Loader-cfg-disableCaching


  5. #5
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    88
    Vote Rating
    5
    Answers
    3
    whirling dervish is on a distinguished road

      0  

    Default


    Ok thanks for the explanation.

    Getting back to my original caching is easy to disable on the loader, but then you have disable it on Ext.Ajax and each proxy. The each proxy part bothers me the most, it is just a lot of code everywhere, granted I would probably roll it up into one constant so I can change it in the future, but it is still less the optimal.

Thread Participants: 1