1. #1
    Touch Premium Member
    Join Date
    Jan 2012
    Posts
    17
    Answers
    2
    Vote Rating
    0
    lrobins is on a distinguished road

      0  

    Default Unanswered: Ext.Ajax.request POST request cache-buster

    Unanswered: Ext.Ajax.request POST request cache-buster


    Is it possible to makek an ajax request with method POST and have it apply the querystring _dc= to make it random so the calls won't be cached? If I make the call using Ext.Ajax.request it does not work with POST, by default it does work for a GET. Also, if the call is made through the proxy of a store, it adds the querystring _dc= to prevent caching.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,118
    Answers
    3504
    Vote Rating
    855
    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


    Code:
    Ext.Ajax.request({
        method : 'POST',
        url    : 'somewhere/over/the/rainbow'
    });
    That for me is having the _dc in the query string
    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
    Touch Premium Member
    Join Date
    Jan 2012
    Posts
    17
    Answers
    2
    Vote Rating
    0
    lrobins is on a distinguished road

      0  

    Default


    Code:
    Ext.Ajax.request({
                headers: {
                    'Content-Type': 'application/json; charset=utf-8'
                },
                method: 'POST',
                params: Ext.JSON.encode({
                    userId: getCookie('id')
                }),
                url: 'services/System.svc/MyMethodCall',
                scope: this,
                success: function (response) {
                    //blah
                },
                failure: function () { //blah }
            });
    When I run that code I don't get the _dc cache buster on the querystring, do the other properties I set cause it to function differently from your code?

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,118
    Answers
    3504
    Vote Rating
    855
    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


    I see it when I use your code.

    Screen Shot 2012-12-19 at 10.46.32 AM.png
    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.

  5. #5
    Touch Premium Member
    Join Date
    Jan 2012
    Posts
    17
    Answers
    2
    Vote Rating
    0
    lrobins is on a distinguished road

      0  

    Default


    I'm using touch 2.0, any idea what could cause the difference?

    image.png

Thread Participants: 1

Tags for this Thread