This module provides a simple API for enabling caching for menu callbacks. This is useful if you have a custom module that defines its own page callbacks in hook_menu(). Reverse proxy caches like Varnish can provide caching for anonymous users, but sometimes you need to cache certain pages for all users. This module, when used in conjunction with the Memcache API and Integration module can be a simple way to increase performance.
You are not limited to your own modules, however. You can add menu callback caching to menu callbacks defined in other modules by implementing hook_menu_alter().
The following example modifies the path "node/%node" to cache page nodes per user for an hour.
<?php
/**
* Implementation of hook_menu_alter().
*/
function my_module_menu_alter(&$items) {
$items['node/%node']['cache'] = MENU_CALLBACK_CACHE_PER_USER;
$items['node/%node']['cache max age'] = 60 * 60;
$items['node/%node']['cache key callback'] = 'my_module_cache_key_callback';
}
/**
* Cache key callback for path node/%node.
*/
function my_module_cache_key_callback($node) {
// Set the cache key if this node is of type 'page'.
if ($node->type == 'page') {
return __FUNCTION__ . '-' . $node->nid;
}
// Don't cache nodes that aren't type 'page'.
else {
Modernizr tells you what HTML, CSS and JavaScript features the user’s browser has to offer. It makes the results available to you in two ways: as properties on a global Modernizr object, and as optional classes on the <html> element. This information allows you to progressively enhance your pages with a granular level of control over the experience.
This Drupal module provides deep integration with the Modernizr JS library, allowing other modules or themes to register tests, load additional assets as needed, and even create new copies of the Modernizr library when a website's requirements change. Read more below.
This project consists of two modules, Boomerang and Boomerang Beacon. The Boomerang module adds Javascript to pages to send statistics to the beacon. The Boomerang Beacon module collects and stores the data. The modules are designed to be autonomous, so they can be run on separate sites. The Beacon is designed to be general purpose, so it can collect data regardless of where the "boomerangs" are coming from.