The browser will not know if it is updated ErrorMessages.xmlon the server. It should issue a request to check if the file has been modified.
You can set the option ifModifiedto truein the jQuery query $.ajax(), since this is the default value false:
$.ajax({
type: "GET",
ifModified: true,
async: false,
url: "../../../ErrorMessages.xml",
dataType: "xml",
success: function (xml) {
}
});
Quote from jQuery.ajax () documentation :
ifModified (Boolean)
Default: false
, . Last-Modified. - false, . jQuery 1.4 "etag", , .
- Last-Modified, XML :
GET /ErrorMessages.xml HTTP/1.1
Host: www.example.com
HTTP/1.1 200 OK
Last-Modified: Wed, 06 Oct 2010 08:20:58 GMT
Content-Length: 1234
:
GET /ErrorMessages.xml HTTP/1.1
Host: www.example.com
If-Modified-Since: Wed, 06 Oct 2010 08:20:58 GMT
HTTP/1.1 304 Not Modified
- , If-Modified-Since, .