Internet Explorer ignoring cache ?

Internet Explorer ignoring cache ?

fpierrefpierre Posts: 2Questions: 1Answers: 0

I've been searching for a solution for a couple of weeks now to no avail.

My web application uses Spring/Hibernate. When I make an AJAX call to retrieve data for my table(using Datatables), everything show up fine. However, when I click on a link and then click BACK to return to the table, IE and Firefox seem to behave differently :

FIREFOX :

  • Display table page (AJAX call);
  • Click link to go to new page;
  • Click Back to return to table page;
  • Database DAO NOT called to re-display data

INTERNET EXPLORER :

  • Display table page (AJAX call);
  • Click link to go to new page;
  • Click Back to return to table page;
  • Database DAO IS called to re-display data

Why is this happening and how can I fix this ? Basically I'd like IE to behave like Firefox in this particular scenario.

$('#tableWithData').DataTable( {
    serverSide : false,
    ajax: {  
         "url": "/app/search/rowData",
        "data": function ( d ) {
            d.searchDeptlCntnrNo   = $('#criteriaDeptlCntnrNo').val();  
            d.searchCntlNoCd       = $('#criteriaCntlNoCd').val();  
            d.searchExactMatch     = $('#criteriaExactMatch').val();                
            d.searchCntlNoCmpnt1   = $('#criteriaCntlNoCmpnt1').val();              
            d.searchCntlNoCmpnt2   = $('#criteriaCntlNoCmpnt2').val();
            d.searchCntlNoCmpnt3   = $('#criteriaCntlNoCmpnt3').val();
            d.searchCntlNoCmpnt4   = $('#criteriaCntlNoCmpnt4').val();
            d.searchRangeField     = $('#criteriaRangeField').val();                
            d.searchCntlNoCmpntQty = $('#criteriaCntlNoCmpntQty').val();
            d.searchCntlNoCmpntRng = $('#criteriaCntlNoCmpntRng').val();

    }},           
    stateSave: true,    
    pagingType: "full_numbers",        
    deferRender: true,        
    scrollY:        400,
    scrollCollapse: true,
    scroller:       true,
    lengthChange:   false,
    "columns": columns,             
    language: {
        "loadingRecords": loading data..."},
    fnInitComplete: function(oSettings, json) {
        $("#loading-div-background").hide();
      },
    language :{
            "emptyTable": "Your query returned 0 results."          
      }

} );  

Answers

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    Sounds like that might just be how the browsers work. What happens on other pages that use Ajax - can you see a similar effect?

    Allan

  • fpierrefpierre Posts: 2Questions: 1Answers: 0

    Thank you for your input Allan.

    In my environment, my only options are to use IE or Firefox. But based on what I've read, it is an IE issue with jQuery :

    jQuery automatically attaches an unload event to the window, so unfortunately using
    jQuery will disqualify your page from being stored in the bfcache for DOM preservation and quick back/forward.
    http://stackoverflow.com/a/1195934/1501426

    It looks like I'm stuck with this. I could open a new window when the user clicks a link but that just bad design.

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    Thanks for the link. That's useful info!

    Allan

This discussion has been closed.