PDA

View Full Version : What does limit=25 means _dc=somenumber means in AJAX Request



vishalnnsingh
23 Mar 2011, 10:02 PM
What does limit=25 and _dc=somenumber means in AJAX Request?

and if unimportant, how can i remove them?

mitchellsimoens
24 Mar 2011, 3:06 AM
limit would be used for paging. Basically it's send that param to request only 25 results.

When you see _dc, that param is what's called a cache busting param. The numbers are a Unix timestamp of the time the request is made. If you want to make sure your server doesn't send a cached version of your data, use this param. If you would like to get cached results, disable it.

jay@moduscreate.com
24 Mar 2011, 4:35 AM
the cache buster is more important for the client side as well as intermediate proxies. I would just leave it on.

vishalnnsingh
24 Mar 2011, 5:00 AM
Thank you so much for the replyin.
The information was really helpful.

vishalnnsingh
24 Mar 2011, 10:30 AM
Can you please suggest me how to remov these two params.

jay@moduscreate.com
24 Mar 2011, 10:34 AM
I'd like to know why you want to disable cache busting?

vishalnnsingh
24 Mar 2011, 11:05 AM
Actually m making an ajax call to an external server which belongs to my client.
This is my store

var userInfo = new Ext.data.Store({
model:'MainUser',
proxy:{
type:'ajax',
url:'http://www.xxx.com/api/v1/users',
extraParams:{
oauth_token:OauthToken,
oauth_token_secret:OauthTokenSecret
},
reader:{
type:'xml',
record:'user'
}
},
autoLoad:true
});

It is supposed to return me an xml response, but i get a blank response.
and firebug shows me an eror.
This is the corresponding php code

dbConnect();
header("Content-type: text/xml");
//some code
//some code
$output = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><user><id>".$user->getIdUser()."</id><username>".$user->getFirstName()." ".$user->getLastName()."</username></user>";
}
}else{
$output = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><user><id>".$user->getIdUser()."</id><username>".$user->getFirstName()." ".$user->getLastName()."</username></user>";
}
echo $output;

Really don't know what to do, thought the extra param is creating an issue, i know its funny tough.
Whenever i say that there is sth wrng wth the php code, the client tries to help me out by showing a form which take two params as the form input if you submit it, it redirects you to a page (standard submit) where the xml is displayed, which kind of makes me feel that i am doing something wrong.