PDA

View Full Version : how to cache Ext.data.store post or get request in extjs 3.4



@naresh
2 Jul 2013, 5:23 AM
hi ,

i have ext.data .store i want to load it first time after that its load data from cache not loading the ajax call .
here is my code in where i have using it.

new Ext.data.Store({
autoLoad:true,
proxy: new Ext.data.HttpProxy({
url: '../xxxxxxxx/xxxxxx',
timeout :12000,
}),
reader: new Ext.data.JsonReader({

} ),

});

mitchellsimoens
4 Jul 2013, 5:54 AM
Why are you loading it after the first time then? Simply don't load the store. Or are you wanting to cache the url and have multiple stores get the cached data from when one of the stores loads?

@naresh
4 Jul 2013, 7:48 AM
thanks for reply .


but i want to load the store only one time after that if i refresh the store for the same parameter . its load the data from cache . when i change the parameter its go the back-end and load the data again .

willigogs
4 Jul 2013, 10:40 AM
Store the original response in a variable somewhere, then on reload simply return false in the beforeload store event, and load in the data stored in the variable instead?

In fact, isn't this already stored anyway underneath the reader?