[jQuery] setRequestHeader('Cache-Control', 'private') ... does not work in $.ajax call

[jQuery] setRequestHeader('Cache-Control', 'private') ... does not work in $.ajax call


I'm using $.ajax() to connect to a web service. In firebug, I notice
in Firebug that the ajax request is sending the following headers:
Pragma: no-cache
Cache-Control: no-cache
However, I want to ALLOW caching on the server side. I've tried the
following, with beforeSend:
$.ajax({
type: "POST",
url: "/ClientWebServices/MyWebService.asmx/WebServiceMethod",
data: jsonString,
contentType: "application/json; charset=utf-8",
dataType: "json",
beforeSend: function(xhr) {
xhr.setRequestHeader('Cache-Control', 'private');
xhr.setRequestHeader('Pragma', '');
},
success: function(msg) {
alert("ok");
},
error: function(xhr, desc, exceptionobj) {
alert("error");
}
});
...however, this does not work properly. Rather than replacing the
header values, it appends them. For example:
Cache-Control: no-cache, private
...this is not the desired effect.
Any thoughts? Thanks!