Drupal is a registered trademark of Dries Buytaert
drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! video_embed_field 3.1.0 Minor update available for module video_embed_field (3.1.0). bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). trash 3.0.27 Minor update available for module trash (3.0.27). twig_tweak 4.0.0-alpha2 New alpha version released for module twig_tweak (4.0.0-alpha2). twig_tweak 4.0.0-alpha1 First alpha version released for module twig_tweak (4.0.0-alpha1). node_revision_delete 2.1.1 Minor update available for module node_revision_delete (2.1.1). commerce_paypal 2.1.2 Minor update available for module commerce_paypal (2.1.2). ckeditor5_premium_features 1.8.1 Minor update available for module ckeditor5_premium_features (1.8.1). ckeditor5_plugin_pack 1.5.2 Minor update available for module ckeditor5_plugin_pack (1.5.2). node_revision_delete 2.1.0 Minor update available for module node_revision_delete (2.1.0).

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.

Activity

Total releases
1
First release
Apr 2026
Latest release
16 hours ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
8.x-1.3 Stable Apr 25, 2026