Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing _dc parameter in Ext

Tags:

extjs

Using Ext, default Ext.Ajax add to GET-request _dc parameter. For example

GET /ConnViewProcessing/?_dc=1263286227619

How to remove this parameter?

PS: it's necessary to manually cache response to ETag and If-None-Match.

like image 810
ko1ik Avatar asked Jan 12 '10 09:01

ko1ik


3 Answers

Set disableCaching option to false:

Ext.Ajax.disableCaching = false;
like image 117
Lukman Avatar answered Nov 20 '22 05:11

Lukman


Using Ext JS 4.1, and after adding the following code to app.js, the _dc parameter disappears:

// Disable _dc parameter

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

// My App

Ext.application({
like image 41
Pencroff Avatar answered Nov 20 '22 05:11

Pencroff


The proper way to accomplish that with Sencha Cmd 6.x is to set a (global) switch in app.json (because all of those hacks and overrides might interfere unnecessarily with the functionality):

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

Then run sencha app refresh, in order to update the application's bootstrap.json.

Alternatively, one can configure Ext.Loader (at run-time):

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

When scrolling upwards and reading the actual question, concerning Ext.Ajax (per request):

Ext.Ajax.request({url: '/ConnViewProcessing', disableCaching: false});

The result: no more _dc parameters on scripted requests.

@see Sencha Cmd 6.x - The Microloader.

like image 17
Martin Zeitler Avatar answered Nov 20 '22 04:11

Martin Zeitler