-
21 Feb 2013 3:12 PM #1
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,
Disable it on the Ajax singleton,Code:Ext.Loader.setConfig({ disableCaching: false });
And then disable it on every single proxy using noCache = false.Code:Ext.Ajax.disableCaching = 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?
-
21 Feb 2013 11:43 PM #2
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
-
22 Feb 2013 5:52 AM #3
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?
-
22 Feb 2013 7:14 AM #4
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:
Read better the docsCode:/*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 });
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.Loader-cfg-disableCaching
-
22 Feb 2013 7:26 AM #5
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.


Reply With Quote