Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7492577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:28:10+00:00 2026-05-29T16:28:10+00:00

I’m developing locally. and I’m using this code for AJAX: function getChart(num,ld,margin,idr) { idr

  • 0

I’m developing locally. and I’m using this code for AJAX:

function getChart(num,ld,margin,idr)
{
    idr = typeof(idr) != 'undefined' ? idr : 0;
    $(ld).style.display="inline-block";
    if (window.XMLHttpRequest)
    {
        // code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    }
    else
    {
        // code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function()
    {
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
            $(ld).style.display="none";
            //to place boxes next to each other
            $("sign_"+num).style.margin=(margin+7)+"px 590px 0 0";
            if(num=="ph"&&$("sign_fx").style.marginTop==$("sign_"+num).style.marginTop&&$("sign_fx").style.marginRight=="590px")
            {
                $("sign_"+num).style.marginRight="605px";
            }
            else if(num=="fx"&&$("sign_ph").style.marginTop==$("sign_"+num).style.marginTop&&$("sign_ph").style.marginRight=="590px")
            {
                $("sign_"+num).style.marginRight="605px";
            }
            else if(num=="fx")
            {
                $("sign_ph").style.marginRight="590px";
            }
            else if(num=="ph")
            {
                $("sign_fx").style.marginRight="590px";
            }
            $("sign_"+num).style.display="block";
            $(num+"_request_ld").style.display="none";
            $(num+"_request_all").style.display="block";
            $(num).style.display="block";
            $(num+"_request").innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET","barchart.php?idu=<?php echo $id_signed_in;?>&num="+num+"&idr="+idr,true);
    xmlhttp.send();
}

when the parameters are the same in getChart function (meaning getChart has been called with same parameters), IE loads from the cache and doesn’t bother calling the server even when refreshing the page. on deleting the cache it gets the data from the server. is this because I’m developing locally??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T16:28:13+00:00Added an answer on May 29, 2026 at 4:28 pm

    Loading from the cache is a feature, not a bug. To defeat it, add a cache-busting parameter such as

    xxx= <new Date().getTime();>  // note, this is meta-code.
    

    or just maintain a counter. In any case, identical GET urls (including the parameters) will cause the cached value to be returned. So you need to force the urls to be different.

    Or use POST instead of GET.

    To put it another way, a basic idea of HTTP GET calls is that they are idempotent. This means that calling (via GET) http://server.com?a=1&b=2 should always return the same answer. Since that should be the case, the response can (and should) be cached.

    Since, apparently, you are not returning the same answer in each call, your url is not idempotent. That is not good from an architectural point of view. While you are first facing a problem with the browser cache, you could also be facing problems with caches at multiple caching points along the path from client to your server. Eg a caching proxy server, etc.

    The cache-busting technique I described above (adding a changing parameter to the URL), will work. But better would be to use a POST request.

    Added

    Caching assumptions in HTTP are complex. I’m simplifying things when I say that HTTP GET urls should be idempotent. Depending on header values and meta-header tags in the HTML body, it is fine to have changing results from a specific GET URL. In the default simple case, the assumption by the browser and intermediate caching points is that the GETs are idempotent.

    Since typical simple data response results don’t set the caching headers explicitly, the assumption is that the results can be cached. Thus the problem the OP ran into.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.