Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Configuration Language Lock 1.0.2 Minor update available for module config_language_lock (1.0.2). Release: Canvas Override 1.0.1 Minor update available for module canvas_override (1.0.1). Release: Media Remote Image 8.x-1.2 Minor update available for module media_entity_remote_image (8.x-1.2). Release: IDNA Convert Service (punycode) 2.0.4 Minor update available for module idna (2.0.4). Release: Bootstrap Cloud 7.1.3 Minor update available for theme bootstrap_cloud (7.1.3). Release: Token Browser 1.0.2 Minor update available for module token_browser (1.0.2). Release: Varbase Project 11.0.8 Minor update available for module varbase_project (11.0.8). Release: Media Remote Image 2.0.0-beta1 First beta version released for module media_entity_remote_image (2.0.0-beta1). Usage Milestone: Term CSV Export Import Module term_csv_export_import crossed 1,000 active installs. Security Coverage: Module Scout Module module_scout now has official Drupal security advisory coverage.

File Cache

953 sites Security covered Drupal 10–11
View on drupal.org

This module allows Drupal to store cache data in the filesystem. This can be used for long-term caching of expensive operations, creating test fixtures, achieving high-speed local caching, sharing cache data across applications, or for easier debugging of cache behavior.

Introduction

This module allows Drupal cache bins to be stored in the filesystem.

Use cases

File Cache can be useful in several real-world scenarios:

  • Long-term caching of expensive data processing results
    Keep costly computed data on disk as a permanent cache which can survive regular cache clears.
  • Test fixtures for data coming from external APIs
    When testing code that interacts with public APIs you can cache the responses from the external services and commit them in the repository. This will make sure tests run reliable and fast since they will not be dependent on network availability.
  • High-speed local caching with RAM-backed storage
    Write cache bins to a local ramdisk (tmpfs) for very fast read/write performance during development. Can even be useful in production environments as an alternative to a traditional memory cache like Redis or Memcached.
  • Shared caching across multiple applications - You can make Drupal data available to other applications by storing it on shared storage (for example a network drive) and using a standard serialization format like JSON or YAML.
  • Easier debugging of cache behavior
    Inspect cache files directly on disk to see what is written, when entries are created, and how cache data evolves over time.
  • Precomputed cache data shipped with deployments
    Generate expensive cache data ahead of time, store it in files, and include those files in the production release so the data is instantly available after deployment.

Related Modules

Redis, Memcache, and MongoDB are the closest caching modules. They are usually used when the website is load balanced and there are multiple servers that use single redis/memcache instance. If you don't use multiple webservers, most likely File Cache will be faster. Also, File Cache works in shared hosting webservers.

Apc and Opcache store cache bins in PHP shared memory. This makes them very fast but the space is limited and usually they are used only for cache and cache_bootstrap cache bins.

Boost generates caches of pages that are directly served by web
server. This is much faster than any solution that uses Drupal page caching system but it's also complex to setup and limited to anonymous pages.

Authcache can cach pages for anonymous and also logged-in authenticated users. Similarly to Boost, it is very fast and also complex to configure. In contrast with Boost though, it uses cache_page cache bin and so it can work with File Cache.

Relation with cacherouter and fastpath_fscache modules for Drupal 6.

Quick Start Installation

Install and enable filecache module as usual. Add the following to site's
settings.php or settings.local.php to set the file cache backend as the default backend:

$settings['cache']['default'] = 'cache.backend.file_system';

Most likely you don't want to store the entire Drupal cache on the filesystem but only specific cache bins. For example you can put the page cache in file storage, but keep using the database backend for all other bins:

$settings['cache']['bins']['page'] = 'cache.backend.file_system';

Next, configure the default location of the cache folder. For security reasons this folder should be outside the webroot. Since the caches might contain sensitive data, this folder should never be exposed on the internet. In this example the cache folder will be located in the path /var/cache/myproject/filecache. Please ensure that this folder is writable by the webserver by configuring the relevant ownership and permissions. Add the following to settings.php or settings.local.php:

# Define the default cache folder.
$settings['filecache']['directory']['default'] = '/var/cache/myproject/filecache';
# Store the entity cache in the private files folder by using the stream wrapper.
$settings['filecache']['directory']['bins']['entity'] = 'private://filecache/entity';
# Store the page cache in a shared network drive so it can be used by multiple Drupal instances.
$settings['filecache']['directory']['bins']['page'] = '/mnt/share/filecache/page';
# Store the container cache in a fast local memory drive.
$settings['filecache']['directory']['bins']['container'] = '/mnt/ramdisk/filecache/container';

Go to Status report page admin/reports/status. Confirm that there
are no errors related to the File Cache module.

Please read README.txt for further information.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Apr 2026
Latest release
4 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
8.x-1.3 Stable 10–11 Apr 25, 2026