JQuery conditional caching: IF-MODIFIED-SINCE returns a 304 response, but does not load from the cache

We require conditional caching in the jsonp file: The idea is that if this JSONP file is modified, it needs to be reloaded in the cient cache, we started using the "If-Modified-SINCE" header, as shown below, so far it works well , we can see the If-Modified-Since header in the request using fiddler, and it returns a 304 response if the date is greater than the jsonp file. Last modified date. But for every answer 304 it does not load the jsonp file data from the cache, it is just empty. but a cached version exists.

Is it possible to say that if the status is 304, loading from the cache (we use the IIS5.0 client: IE 8)? and jquery calls don't even save the date and time of the call when it uses only the same date as the header

The following is an example code snippet, donno the way we use is incorrect or not supported, please help me out of this puzzle:

var myUrl = 
$.ajax({
  url: "something.jsonp",
    var myUrl = 
    $.ajax({
      url: "something.jsonp",
      type:"GET",
      cache: true,
      ifModified: true,
      callback: headerCallback,
      Async: true,
      beforeSend(xhr){
      xhr.setrequestheader("If-Modifed-Since","Wed, 13 Aug 2014 10:09:19 GMT");

    },
      success: function(a){
       a.body(..........),
       LoadAllMyData()
      }
    });
Run code
+4
source share

All Articles