我正在通过 ajax 函数获取我的网站子页面。一切运作良好。但是当我在控制台中检查请求时,我收到以下报告
Cache-Control no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection close
Content-Length 6663
Content-Type text/html
Date Wed, 11 Apr 2012 16:29:51 GMT
Expires Thu, 19 Nov 1981 08:52:00 GMT
Pragma no-cache
Server LiteSpeed
Vary Accept-Encoding, User-Agent
X-Powered-By PHP/5.3.10
它表明内容没有被缓存。它显示过去日期的标头到期。但是在ajax()的 jquery 页面中,我读到默认情况下所有 ajax 调用都被缓存。有什么问题?这是我的代码
<script type="text/javascript">
$("#subpage1").click(function() {
$("#wrapper").empty();
$("#wrapper").html('loading');
$.ajax({
url: 'subpage/1.html',
success: function(data) {
$("#wrapper").html(data);
}
});
});
</script>
我是 jquery 和 ajax 的新手。