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 6223425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:29:18+00:00 2026-05-24T08:29:18+00:00

I have built a test app on android using this cool-ass PhoneGap framework, but

  • 0

I have built a test app on android using this cool-ass PhoneGap framework, but the problem is the AJAX request can get data from a remote server using jQuery AJAX but once it completes one request the data seems to stick and when I change the response coming from the server, the change is not reflected upon a new request. Here is the AJAX Request in the application itself:

$.getJSON('http://example.com/test1.php', function(data){
    alert(data.rec);
});

Here is the PHP code on the remote server:

header('Content-type: application/json');

$arr = array("resp"=>"response has changed");
echo json_encode($arr);

My question is, why? Why won’t the change reflect itself from the application?

  • 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-24T08:29:19+00:00Added an answer on May 24, 2026 at 8:29 am

    In order for jQuery AJAX to not cache the server response on shorthand AJAX requests like $.getJSON(), you have to setup a global setting that tells subsequent AJAX requests to not cache the server response. You can do this using $.ajaxSetup(). Do it like this

    $.ajaxSetup({
        cache: false
    });
    

    In order to further prevent caching of server responses use the headers that Tincho Revert posted in his response, they are as follows:

    header("Expires: Tue, 01 Jul 2001 06:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built a test android app and signed it successfully and then sent
Trying to unit test a web application using mstest I have that problem with
I have built a simple C#.Net app on a M/C with only .Net FX
I have built a web page which contains a Crystal Report built using the
The built-in emulator from the WP7 Tools doesn't have the Bing App installed, and
I have built a WCF Service that is being consumed by a Silverlight app.
I have posted this on the Google Web Toolkit Discussion Group but hopefully you
This is no typical programming question. I am currently developing an app using the
I have built an MSI that I would like to deploy, and update frequently.
I have built an application in C# that I would like to be optimized

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.