Boost: store the cache in a different directory

Last updated on
30 April 2025

You are browsing documentation for an older version of Drupal, which is not supported any longer, and the information may not be correct. See current documentation for Contributed modules

By default, boost stores its cache in the "cache" directory located at the root of the website.

A frequent request is to store the cache on a per-site directory under other files generated by the site, in sites/example.org/files/cache/, for example. However, this is likely to cause issues with how the Drupal htaccess rules for multi-site work.

Note that the default way boost stores the cache does support multi-sites. You should not need to change this setting unless you have specific requirements.

If you need to change the location of the cache:

  • Go to admin/config/system/boost/filesystem,
  • Change the "Root cache directory", for example, instead of "cache", you can use "sites/cache",
  • Click on "Save configuration".
  • Then go to admin/config/system/boost/htaccess/generator to get a new version of the htaccess rules to insert into your .htaccess.

If you want to store the cache outside your Drupal directory hierarchy, you will need to create a symlink to the real location or create an Apache alias.

Further reading:

Help improve this page

Page status: Not set

You can: