PDA

View Full Version : ext 4 mvc pattern viewport refresh reloading unique script files



foobarr
7 Dec 2011, 11:38 AM
I am porting an ext-3.4 viewport app to ext-4.0, and I have used the suggested ext4 mvc architecture. During dev I refresh the viewport frame (right-click => This Frame => Reload Frame) to load the latest changes to javascript source files.

The problem is that Firebug shows multiple "versions" (1 foreach refresh !) of *every* js file referenced by the app, where ext (apparently) makes each version unique by appending ?_dc=<UNIQUE_INTEGER> to each filename.

I do not want to have to delete the browser cache, b/c this app is embedded in a framework, and deleting the browser cache makes the refresh cycle longer...requiring a re-login to the framework, etc.

Is there a way to configure ext 4 so that it does not load javascript files as unique on frame refreshes?

Thanks

tobiu
7 Dec 2011, 12:18 PM
you can disable the caching param which is added to each file:
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.Loader-cfg-disableCaching

be aware that this is not intended for development though: if you make changes to a js file you are running danger that the browser does not refresh it.

foobarr
8 Dec 2011, 6:34 AM
Thank you for the ├╝ber fast response Tobias. You rock like a hurricane ;) I found how to use Ext.Loader.disableCaching under Ext.Loader.setConfig()...and it works.

btw: the example given under Ext.Loader.setConfig() documentation contains an error => a script end tag w/o slash.

tobiu
8 Dec 2011, 6:57 AM
thx.

i put the doc error into our bugtracker -> EXTJSIV-4662