0

I have small problem with my recent project build in HTML and Javascript + jQuery only. I would like to prevent page caching as I need to refresh some area of page with some time interval.

If I reload the page, then we can set the "no-cache" META tag into header. But I am not going to reload the page and though jQuery calls XML files with AJAX those javascript files are getting cached and Memory overhead occurs. Because of this my FireFox crashes and memory usages increase up to 2 GB.

Can any one suggest me something fruitful so that I can solve memory overhead problem and running my application over browser smoothly.

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();
    });
}

This is the code and show_topology() is been called frequently to make different status of Topology everytime.

2
  • Refer : [Avoid Caching Javascript][1]. I think this can help you. Cheers.!!! [1]: stackoverflow.com/questions/1011605/… Commented Apr 23, 2012 at 10:31
  • Alternatively you can turn caching off at server side with.htaccess to sertain adresses. Commented Apr 23, 2012 at 10:37

1 Answer 1

2

disable jquery ajax cache:

$.ajax({cache: false});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.