Introduction

This module allows Drupal cache bins to be stored in files.

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 (Drupal 7)

Install and enable filecache module as usual. Add the following to site's
settings.php:

$conf['cache_backends'] = array('sites/all/modules/filecache/filecache.inc');
$conf['cache_default_class'] = 'DrupalFileCache';

You may need to adjust filecache.inc path if filecache is not installed globally.

Go to Status report page admin/reports/status. Run cron. Confirm that there
are no errors and there is only a warning for using the default location.

SECURITY NOTE: The default location depends on the webserver to deny web access
to directories that start with ".ht". Check if there is HTTP error 403 Forbidden
and if it is not, you MUST NOT LEAVE THE CONFIGURATION AS IS IN THIS CASE.

If directories starting with ".ht" are denied access to, you may safely follow
the instructions in Status report to remove the warning.

Please read README.txt for further information.

Quick Start Installation (Drupal 8 + 9)

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';

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:

$settings['filecache_paths']['default'] = '/var/cache/myproject/filecache';

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.

Supporting organizations: 

Project information

Releases