function admin_menu_js_cache

cis7 admin_menu.module admin_menu_js_cache()
cle7 admin_menu.module admin_menu_js_cache()
elmsmedia7 admin_menu.module admin_menu_js_cache()
icor7 admin_menu.module admin_menu_js_cache()
meedjum_blog7 admin_menu.module admin_menu_js_cache()
mooc7 admin_menu.module admin_menu_js_cache()

Menu callback; Output administration menu for HTTP caching via AJAX request.

See also


2 string references to 'admin_menu_js_cache'
admin_menu_js in sites/all/modules/ulmus/admin_menu/admin_menu.module
Implements hook_js().
admin_menu_menu in sites/all/modules/ulmus/admin_menu/admin_menu.module
Implements hook_menu().


sites/all/modules/ulmus/admin_menu/admin_menu.module, line 332
Render an administrative menu as a dropdown menu at the top of the window.


function admin_menu_js_cache() {
  global $conf;

  // Suppress Devel module.
  $GLOBALS['devel_shutdown'] = FALSE;

  // Enforce page caching.
  $conf['cache'] = 1;

  // If we have a cache, serve it.
  // @see _drupal_bootstrap_page_cache()
  $cache = drupal_page_get_cache();
  if (is_object($cache)) {
    header('X-Drupal-Cache: HIT');
    // Restore the metadata cached with the page.
    $_GET['q'] = $cache->data['path'];


    // We are done.

  // Otherwise, create a new page response (that will be cached).
  header('X-Drupal-Cache: MISS');

  // The Expires HTTP header is the heart of the client-side HTTP caching. The
  // additional server-side page cache only takes effect when the client
  // accesses the callback URL again (e.g., after clearing the browser cache or
  // when force-reloading a Drupal page).
  $max_age = 3600 * 24 * 365;
  drupal_add_http_header('Expires', gmdate(DATE_RFC1123, REQUEST_TIME + $max_age));
  drupal_add_http_header('Cache-Control', 'private, max-age=' . $max_age);

  // Retrieve and return the rendered menu.
  return admin_menu_output();