1. #1
    Sencha User
    Join Date
    Feb 2013
    Posts
    48
    Vote Rating
    0
    @naresh is on a distinguished road

      0  

    Default how to cache Ext.data.store post or get request in extjs 3.4

    how to cache Ext.data.store post or get request in extjs 3.4


    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({

    } ),

    });

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,548
    Vote Rating
    872
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    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?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Feb 2013
    Posts
    48
    Vote Rating
    0
    @naresh is on a distinguished road

      0  

    Default


    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 .

  4. #4
    Sencha User
    Join Date
    Jan 2011
    Posts
    546
    Vote Rating
    53
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      0  

    Default


    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?

Thread Participants: 2