CSS coding standards

To minimize friction when contributing to CSS, the front-end developers of the Drupal community have reached consensus about our coding standards for:

  • Formatting CSS code.
  • CSS architecture, including goals, pitfalls and best practices.
  • Grouping rulesets into files.

Despite our natural range of working styles and coding preferences, we value collaboration and ease of development, so we have attempted to explain our standards clearly in the following documents.

site search

when i search for "organic groups" and tick "modules" this project doesn't show up



Cache chain

BackendChain defines a chained cache implementation for combining multiple cache backends.

Multiple Backends

All cache implementations have to implement CacheBackendInterface. DatabaseBackend is Drupal's default cache implementation. It uses the database to store cached data. Each cache bin corresponds to a database table by the same name.


The new cache API introduces a new way to “remove” a cache item. In addition to the existing delete methods where cache entries are permanently deleted, cache entries can now also be invalidated.

Delete methods
delete(), deleteMultiple(), deleteTags(), deleteAll(), deleteExpired()
Invalidate methods
invalidate(), invalidateMultiple(), invalidateTags(), invalidateAll()

Invalidation is like a “soft delete” where items are not deleted but only marked as invalid, meaning “not fresh” or “not fresh enough”. An item automatically becomes invalid when the expire time specified in the set() call is reached, or it may explicitly be marked as invalid using the functions listed above. The invalid items are not returned by a normal get() call, so in most ways they act as they have been deleted. However, by passing TRUE as the second argument for get(), it is possible to fetch the invalid value.

// Explicit invalidation
cache()->set('foo', 123);
cache()->get('foo'); // Returns a cache item
cache()->get('foo'); // Returns FALSE
cache()->get('foo', TRUE); // Returns a cache item
cache()->get('bar', TRUE); // Returns FALSE

// Expired items
cache()->set('bar', 123, REQUEST_TIME + 60);
cache()->get('bar'); // Returns a cache item

Cache tags

A previous, temporary implementation that implemented prefix/wildcard cache clears in Drupal 8 (deletePrefix()) has since been removed in favor of the new tag invalidation functionality.



Subscribe with RSS Subscribe to RSS - Drupal 8.x