ブラウザのキャッシュを修正notmodified
して JSON に応答する方法は? 応答時にjQuery.ajax({ifModified:true,cache:true})
JSON 要求が中断されます。data
初めてのブラウザ リクエストhttp://localhost/apiは、ステータス200 OK
と次を返します304 Not Modified
$.ajax({
type:"GET",
url:'http://localhost/api', // {"content"="Hello!"}
dataType:'json',
cache:true,
ifModified:true, // Lets respond `304:notmodified`
success:function(data,textStatus,jqXHR){
console.debug(jqXHR.status+':'+textStatus);
console.debug(data); // Why on repeated request returns `undefined`?
}
});
XHR の初回は OK を返します:
200:success
Object {content="Hello!"}
しかし、次回はdata
undefinedを返します:
304:notmodified
undefined
それを解決する方法は?jQuery 1.5.1 のバグのようです。期待される結果:
304:notmodified
Object {content="Hello!"}