$.ajaxSetup 缓存:jquery 代码中的含义是什么
$.ajaxSetup cache: What does that mean in jquery code
今天我在 Jquery 代码中观察到以下内容:
$.ajaxSetup({ cache: false });
这是什么意思?如果缓存的值变成 True
.
会发生什么
提前致谢
cache (default: true, false for dataType 'script' and 'jsonp'
)
Type: Boolean
If set to false, it will force requested pages not to be
cached by the browser. Note: Setting cache to false will only work
correctly with HEAD and GET requests. It works by appending
"_={timestamp}" to the GET parameters. The parameter is not needed for
other types of requests, except in IE8 when a POST is made to a URL
that has already been requested by a GET.
今天我在 Jquery 代码中观察到以下内容:
$.ajaxSetup({ cache: false });
这是什么意思?如果缓存的值变成 True
.
提前致谢
cache (
default: true, false for dataType 'script' and 'jsonp'
) Type: Boolean If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET.