Improve the real or perceived speed of the site, or monitor performance metrics.

CSS Embedded Images

How does it work?

According to Wikipedia, "the data URI scheme is a URI scheme that provides a way to include data in line in web pages as if they were external resources." That means that rather than having a URL telling the browser where to find the image you actually have the image data right there on the page so the browser does not have to make an extra request to get it. This particular module is only concerned with images referenced in CSS, so for an example let's look at a declaration in Garland's CSS:

ul li.expanded {
  background: transparent url(images/menu-expanded.gif) no-repeat 1px .35em;
}

When we embed the image into the CSS, it becomes:

ul li.expanded {
  background: transparent url(data:image/gif;base64,
  R0lGODlhCgAKAMQUAM/Q0vT09Ojr7s7Q0dLU1f7+/u/z9+Dj5tfX1+Dg4MrKyu
  fq7tfZ27m5uba2tsLCwvv7+7W1tbS0tP////P3+wAAAAAAAAAAAAAAAAAAAAAA
  AAAAAAAAAAAAAAAAAAAAACH5BAEAABQALAAAAAAKAAoAAAU0ICWOZGkCkaRKEU
  AtTzHNU/Es1JDQUzKIggZkBmkIRgTEDEEgGRyBgMNQYigUDBPlcCCFAAA7) no-repeat 1px .35em;
}

The actual process is a bit more involved than that, but this is the general concept. By default, embedded images are placed in a separate CSS file to allow for parallel rendering of other site styles while the relatively large image data is being downloaded.

AJAX Cache

AJAX Cache acts much like imagecache by generating the result of a request on demand and storing it on the filesystem for later reuse. This is useful if you are trying to scale a site that makes many dynamic ajax calls. AJAX cache saves results directly to the files so the web server can serve them directly, rather then bootstrapping Drupal.

AJAX Cache will do nothing by itself. Supporting code must call it.

How to use

First you define the presets you are going to use like this:

/**
 * Test implementation of hook_ajaxcache_presets().
 */
function ajaxcache_ajaxcache_presets() {
  return array(
    'test' => array(
      // Name of your function that outputs the data to be cached
      'callback' => 'ajaxcache_test_callback',

      // Optional: include file where the callback is located.
      // 'file' => 'include.inc',

      // Optional: file extension to be used when serving the file. Defaults to html.
      // 'extension' => 'json',

      // Optional: file name (without extension) to be used when serving the file. Defaults to ajax.
      // 'filename' => 'test',
    ),
  );

Then, instead of passing javascript the URL that would point to your output function through the menu system, you pass the URL returned by:

ajaxcache_get_url($preset_name, $args);

Middleware client

A middleware client. This module is a client for middleware server module.

Namespice

Namespace for cache. Namespice implements simple API containing wrapper functions for cache management using concept of tags.
Supported cache backend: Memcached (both Memcache API and Cacherouter-Memcache should work).
This is an API module for developers, it doesn't have any usage on it's own. Install it only when required by other module.

State of this module

Namespice is experimental. It's features and ideas will likely be incorporated into some cache backend project, to fully support cache lifetime, stampede protection etc.

Features

  • Tagging of cache entries.
  • Optimized serial storage
  • Atomic serial operations. Multiple thread friendly

Advanced Panels Cache

Cache plugins for Panels module. Currently implemented node based cache plugin. Node based cache is intended for panels/panes which update together with nodes they contain.
Advantages:

  • Instant updates. Users don't see old content.
  • Granular updates: only panes/panels containing changed nodes are flushed. Highest cache efficiency.
  • Works for registered users too and complements anonymous page caching

Supported cache backends: Memcached (both Memcache API and Cacherouter-Memcache should work). Other cache backends are not supported because of the way Namespice module works.

This module is not recommended for production use yet: because of undecided status of Namespice module, Advanced Panels Cache remains experimental too.

Pages

Subscribe with RSS Subscribe to RSS - Performance