Index: ajax/authcache.php =================================================================== --- ajax/authcache.php (revision 2296) +++ ajax/authcache.php (working copy) @@ -43,9 +43,11 @@ $response = NULL; // Ajax response + // Loop through GET key/value pairs, call functions, and return results -if(is_array($_GET)) { // GET is faster than POST - foreach($_GET as $key => $value) { +$source = authcache_get_global_array(); +if(is_array($source)) { // GET is faster than POST + foreach($source as $key => $value) { $func_name = "_authcache_$key"; if(function_exists($func_name)) { $r = $func_name($value); @@ -65,9 +67,9 @@ // Should browser cache this response? (See authcache_example for possible usage) // This must be placed after bootstrap since drupal_page_header() // will define header to make pages not cache -if(isset($_GET['max_age']) && is_numeric($_GET['max_age'])) { +if(isset($source['max_age']) && is_numeric($source['max_age'])) { // Tell browser to cache response for 'max_age' seconds - header("Cache-Control: max-age={$_GET['max_age']}, must-revalidate"); + header("Cache-Control: max-age={$source['max_age']}, must-revalidate"); header('Expires: ' . gmdate('D, d M Y H:i:s', time()+24*60*60) . ' GMT'); // 1 day } Index: authcache.admin.inc =================================================================== --- authcache.admin.inc (revision 2296) +++ authcache.admin.inc (working copy) @@ -30,6 +30,18 @@ '#type' => 'checkbox', '#description' => t('This is required when you first enable the Authcache module & anonymous caching, otherwise logged-in users may receive pages intended for anonymous visitors. All users will need to relogin after this.'), ); + + $form['authcache_ajax_method'] = array( + '#title' => t('Method used to send ajax'), + '#type' => 'radios', + '#options' => array( + 'get' => "GET", + 'post' => "POST" + ), + '#description' => t('Determinate method to send ajax with'), + '#default_value' => variable_get('authcache_ajax_method', 'get'), + ); + $form['debug'] = array( '#type' => 'fieldset', @@ -145,6 +157,7 @@ variable_set('authcache_debug_page', $form_state['values']['debug_page']); variable_set('authcache_debug_users', $debug_user_ray); variable_set('authcache_roles', $cache_roles); + variable_set('authcache_ajax_method', $form_state['values']['authcache_ajax_method']); drupal_set_message(t('Your Authcache settings have been saved.')); Index: authcache.module =================================================================== --- authcache.module (revision 2296) +++ authcache.module (working copy) @@ -131,6 +131,8 @@ // Initialize Authcache after all other JS is loaded drupal_add_js('jQuery(function() { Authcache.init(); });', 'inline', 'header'); + $data = array('Authcache' => array('ajax_method' => variable_get('authcache_ajax_method', 'get'))); + drupal_add_js($data, 'setting', 'header'); // Forcibly disable Drupal's built-in SQL caching // (No need to cache page twice for anonymous users) Index: js/authcache.js =================================================================== --- js/authcache.js (revision 2296) +++ js/authcache.js (working copy) @@ -150,7 +150,7 @@ $.ajax({ url: Drupal.settings.basePath, // index.php - type: "GET", + type: Drupal.settings.Authcache.ajax_method, dataType: "json", data: jsonData, Index: authcache.inc =================================================================== --- authcache.inc (revision 2296) +++ authcache.inc (working copy) @@ -182,4 +182,15 @@ } return FALSE; +} + +/** + * Returns global array depends of method we send ajax + */ +function authcache_get_global_array() { + $method = variable_get('authcache_ajax_method', 'get'); + if ($method == 'post') { + return $_POST; + } + return $_GET; } \ No newline at end of file