A better solution to the caching issues faced. Set jQuery's global Ajax parameter 'cache' to false, and also set the 'Cache-Control' header to 'no-cache'
This commit is contained in:
@@ -16,13 +16,11 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a parameter for all Ajax queries made on this page. Append a random
|
* Set a parameter for all Ajax queries made on this page. Don't let the
|
||||||
* number to tell server that each Ajax request is a new one
|
* web server serve cached pages
|
||||||
*/
|
*/
|
||||||
$.ajaxSetup({
|
$.ajaxSetup({
|
||||||
data: {'random': function() {
|
cache: 'false'
|
||||||
return Math.random();
|
|
||||||
}}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -163,13 +163,10 @@ $(document).ready(function() {
|
|||||||
/**
|
/**
|
||||||
* Set a parameter for all Ajax queries made on this page. Some queries
|
* Set a parameter for all Ajax queries made on this page. Some queries
|
||||||
* are affected by cache settings on the server side, and hence, show stale
|
* are affected by cache settings on the server side, and hence, show stale
|
||||||
* data. Append a random number to tell server that each Ajax request is a
|
* data. Don't let the web server serve cached pages
|
||||||
* new one
|
|
||||||
*/
|
*/
|
||||||
$.ajaxSetup({
|
$.ajaxSetup({
|
||||||
data: {'random': function() {
|
cache: 'false'
|
||||||
return Math.random();
|
|
||||||
}}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -108,13 +108,11 @@ function appendInlineAnchor(disp_mode) {
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a parameter for all Ajax queries made on this page. Append a random
|
* Set a parameter for all Ajax queries made on this page. Don't let the
|
||||||
* number to tell server that each Ajax request is a new one
|
* web server serve cached pages
|
||||||
*/
|
*/
|
||||||
$.ajaxSetup({
|
$.ajaxSetup({
|
||||||
data: {'random': function() {
|
cache: 'false'
|
||||||
return Math.random();
|
|
||||||
}}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -14,13 +14,11 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a parameter for all Ajax queries made on this page. Append a random
|
* Set a parameter for all Ajax queries made on this page. Don't let the
|
||||||
* number to tell server that each Ajax request is a new one
|
* web server serve cached pages
|
||||||
*/
|
*/
|
||||||
$.ajaxSetup({
|
$.ajaxSetup({
|
||||||
data: {'random': function() {
|
cache: 'false'
|
||||||
return Math.random();
|
|
||||||
}}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -2937,6 +2937,7 @@ function PMA_ajaxResponse($message, $success = true, $extra_data = array())
|
|||||||
|
|
||||||
// Set the Content-Type header to JSON so that jQuery parses the response correctly
|
// Set the Content-Type header to JSON so that jQuery parses the response correctly
|
||||||
if(!isset($GLOBALS['is_header_sent'])) {
|
if(!isset($GLOBALS['is_header_sent'])) {
|
||||||
|
header('Cache-Control: no-cache');
|
||||||
header("Content-Type: application/json");
|
header("Content-Type: application/json");
|
||||||
}
|
}
|
||||||
echo json_encode($response);
|
echo json_encode($response);
|
||||||
|
@@ -1731,6 +1731,11 @@ if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs
|
|||||||
|
|
||||||
// A user was selected -> display the user's properties
|
// A user was selected -> display the user's properties
|
||||||
|
|
||||||
|
// In an Ajax request, prevent cached values from showing
|
||||||
|
if($GLOBALS['is_ajax_request'] == true) {
|
||||||
|
header('Cache-Control: no-cache');
|
||||||
|
}
|
||||||
|
|
||||||
echo '<h2>' . "\n"
|
echo '<h2>' . "\n"
|
||||||
. PMA_getIcon('b_usredit.png')
|
. PMA_getIcon('b_usredit.png')
|
||||||
. __('Edit Privileges') . ': '
|
. __('Edit Privileges') . ': '
|
||||||
|
Reference in New Issue
Block a user