Cache

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
peterx's picture

A generic cache module for things that do not fit in the database.

There are several modules caching files through home grown code. One mail module uses a CAS module but the CAS module does not uniquely identify content. A generic cache module would guarantee unique identification of each item.

The module would accept an application identifier, an item identifier, the item, then store the item in the database or file system based on size and other rules set up in the administration page. The application identifier could be the name of the calling module name and could have an additional identifier added to allow for multiple applications within a module. The item identifier could be anything of meaning to the calling module. There would be options to pass through some common identifiers including the user supplying the item. There would be an option to log creation and deletion.

Optional layers could create an entity or node for the item so the calling module can create both in one hit. The layers could return an entity object or a URL. The viewing rules for file items would be in the optional layers. The base cache would use the standard Drupal private viewing system.

I wrote a number of cache systems for various applications outside of Drupal and would be happy to mentor development by someone in Sydney who wants to learn module development.

Comments

This is really confusing as

dawehner's picture

This is really confusing as drupal core already defines a generic cache solution:

  • provide cache_set, cache_get etc.
  • Allow to have different cache backends
  • use different cache backends dependent on the cache "bin", for example "cache_path" or "cache_page".
    This seems to be what you mean with application.

The existing cache is for database entries

peterx's picture

If the current cache system is generic and the backend is replaceable, how do you set up a cache for some image files without altering the processing of other image files or exisitng cache data? The current system, as described in published pages, caches database rows, not physical items. You have to write something else to cache non database items.

The current database row cache can be replaced with something that caches the same data in a different form. The replacement does not make the new backend accept different types of data. Some of the replacements might be able to cache something other than database rows but you still need to provide a connection. The connection is more difficult when you decide to use some of the alternatives without replacing the existing Drupal cache.

Well sure that's true, but

dawehner's picture

Well sure that's true, but the cache system is currently an API, so if you don't call the API it doesn't do anything for your.

Contributed Module Ideas

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: