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

  • Home
  • SEARCH
  • 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 an iOS app that leverages Core Location Framework. I have Xcode
I'm using this code snippet to encrypt/decrypt data in my app's database: http://www.androidsnippets.com/encryptdecrypt-strings It
I've been trying to see ProGuard in action with my test Android app. Do
I have several android devices I would like to test on. Currently, when I
I want to add my own framework code that runs in the Android system_server
I build an in-app purchase application. I don't know why Android Market return CANCELED
I have tried all that i could to generate the R.java file but in
I'm working on a Honeycomb tablet app that needs to scale some UI views
I would like my app to start with a ProgressDialog while it connects to

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.