我有一个小问题,我最近的项目建设在超文本标记语言和Javascript + jQuery只。我想防止页面缓存,因为我需要以一定的时间间隔刷新页面的某些区域。
如果我重新加载页面,那么我们可以在header中设置"no-cache“元标记。但是我不打算重新加载页面,尽管jQuery使用AJAX调用XML文件,但这些javascript文件会被缓存,并且会产生内存开销。正因为如此,我的FireFox崩溃和内存使用量增加到2 GB。
有没有人能给我一些有用的建议,这样我就可以解决内存开销问题,并在浏览器上流畅地运行我的应用程序。
function refresh() {
    $('#table_info').remove();
    $('#table').hide();
    if (refreshTimer) {
        clearTimeout(refreshTimer);
        refreshTimer = null ;
    }
    $.ajax({
        document.getElementById('refresh_topology').disabled=true; 
        $('<div id="preload_xml"></div>').html('<img src="pic/dataload.gif" alt="loading data" /><h3>Loading Data...</h3>').prependTo($("#td_123"));
        $("#topo").hide();
        $('#root').remove();
        show_topology();
    });
}这是代码,show_topology()经常被调用,以使每次的拓扑状态不同。
发布于 2012-04-23 19:20:42
禁用jquery ajax缓存:
$.ajax({cache: false});https://stackoverflow.com/questions/10278781
复制相似问题