Currently, I have set up an ajax call, that on change of a particular field it should execute a php script. The script first executes on page load.
AJAX Call
$j.ajax({url: prod_json_url, dataType: 'json', cache: true,
beforeSend: function( xhr ) {
xhr.overrideMimeType( 'text/plain; charset=x-user-defined' );
},
success: function(data) {
//things to do on success with JSON
}
});
Everything works great in my virtual environment for testing, but when I deploy this to a different server the following happens.
1) On page load, I can view the URL in FireBug being executed and returning the correct JSON Response. Logging shows that it did go to the script to be executed and returns the correct data. Everything acts as it should.
2) I then click to update the field. By viewing Firebug in the Console again, the correct URL is being executed, however, the JSON response is incorrect. It keeps the same one that occurred on page load. When I added logging, it appears that it never actually reaches the updated URL. (Which is the same URL as page load with updated arguments).
3) If I wait some time, and try again, it sometimes behaves as it should again, but only for the one execution.
This behavior makes me believe it is a cacheing issue. Does anyone have an idea of how I can resolve this or what variable I should be looking for or checking? The database is exactly the same and I'm not sure what else might be causing this. Any help is greatly appreciated! Please let me know if more information would be helpful as well.