atomic_cas
Atomic CAS provides content-addressable storage for Drupal file entities. Instead of storing every uploaded file as a separate physical copy, the module hashes file contents and stores the source bytes once per unique hash. Multiple file entities can reference the same underlying blob while preserving normal Drupal file semantics such as filenames, file entity IDs, and access control.
Features
- Deduplicates uploaded source files by SHA-256 content hash.
- Provides
cas-public://andcas-private://stream wrappers. - Preserves Drupal file entity behavior with logical per-file URIs like
cas-public://{fid}/{filename}. - Serves public files through versioned URLs and private files through Drupal-controlled access checks.
- Deduplicates identical image style derivatives for CAS-backed images.
- Provides Drush commands for migration, garbage collection, and blob auditing.
This module is useful for media-heavy Drupal sites where the same file is uploaded multiple times, such as editorial, local government, publishing, and document-heavy platforms.
Post-Installation
After enabling the module, configure protected blob storage roots in settings.php. Atomic CAS stores physical blobs outside normal public file handling and expects these directories to be writable by Drupal.
Typical setup:
- Enable the module.
- Add
atomic_cas_public_rootandatomic_cas_private_roottosettings.php. - Choose or configure file fields that should use CAS-backed storage.
- Use the provided Drush commands to migrate existing files if needed.
- Use manual garbage collection after validating file references.
Public files are exposed through routed URLs. Private files remain protected by Drupal access control.
Additional Requirements
- Drupal 10.3 or Drupal 11.
- Writable filesystem locations for CAS public and private blob roots.
- Drush is recommended for migration, audit, and garbage collection workflows.
Recommended modules/libraries
- Drush, for migration, auditing, and garbage collection commands.
Similar projects
Atomic CAS focuses specifically on deduplication via content-addressable storage while preserving Drupal file entity semantics. It is designed for sites that want to reduce duplicate file storage without replacing Drupal's file and media model with a remote-object-only workflow.
Supporting this Module
Issues, testing, documentation improvements, and real-world implementation feedback are all valuable contributions during the alpha stage.
Community Documentation
Project documentation should cover installation, required settings.php configuration, migration, rollback, image derivative behavior, and garbage collection workflow.
Status: This project is currently alpha. It is intended for early adopters and further validation before stable production use.