1

So far i was able to set

'disableCaching: false' 

in Ext.Loader.config(in app.js) and debug extjs applications on chrome browser. But now, on inspecting the source, i see that the files have filename.js?dc=1123123 and every time the files are fetched from remote and not cached. So i am unable to set breakpoints and debug run-time on browser. Please note that this scenario is when i do a browser refresh.

Plz let me know how i can resolve this issue.

optimusPrime
  • 249
  • 5
  • 16

4 Answers4

3

Set disableCacheing to false in app.js before Ext.application({...

Ext.Loader.setConfig({
    disableCaching: false
});

This will remove _dc cache param from requests that are getting files.

For disabling _dc on XHR Ext.Ajax requests use

Ext.Ajax.disableCaching = false;

And for proxy communication with server use noCache property on Ext.data.proxy.Server class.

noCache: true

You can also set cache config in app.json file.

"loader": {
    // This property controls how the loader manages caching for requests:
    //
    //   - true: allows requests to receive cached responses
    //   - false: disable cached responses by adding a random "cache buster"
    //   - other: a string (such as the build.timestamp shown here) to allow
    //     requests to be cached for this build.
    //
    "cache": "${build.timestamp}",

    // When "cache" is not true, this value is the request parameter used
    // to control caching.
    //
    "cacheParam": "_dc"
}

Also if using Chrome Dev Tools for debugging take a look at disableCache on Networks tab and if using FF use CTRL + F5 insted F5 to reload page

Community
  • 1
  • 1
Davor Zubak
  • 4,578
  • 13
  • 54
  • 91
  • i have set disableCaching: false in Ext.Loader.setConfig. But i still see the _dc param for all requests(proxy json and js files). also, the disable cache is unchecked in network tab in chrome debug. i still am unable to cache files. – optimusPrime Dec 12 '14 at 12:22
0

Setting Ext.Loader configuration is one thing. There is also something called Ext.Boot which is used before loader is up and running. Boot has his own disableCaching setting. It defaults to something like this:

disableCaching: (/[?&](?:cache|disableCacheBuster)\b/i.test(location.search) ||
    !(/http[s]?\:/i.test(location.href)) ||
    /(^|[ ;])ext-cache=1/.test(doc.cookie)) ? false :
    true,

Probably files with dc appended to url are loaded by Boot. If you want to disable it permanently just replace this code and set it to false.

Krzysztof
  • 15,250
  • 2
  • 42
  • 71
0

Add ?cache=false to the end of your URL to temporarily disable caching on a per-request basis.

Robert Watkins
  • 2,136
  • 15
  • 17
0

app.json:

"loader": {"cache": true},

then:

sencha app refresh

it may seem confusing, but the _dc parameter then won't be present anymore - at all.

Martin Zeitler
  • 49,224
  • 12
  • 97
  • 156