Safely remove a limited number of items from the cache_form table.

This module provides a drush command drush safe-cache-form-clear that can be run at a high frequency, keeping the table at a reasonable size. It requires that you use the database cache back-end for the cache_form table.

Drupal's core cron can have problems clearing out the cache_form table when it grows extremely large. This module works around this by limiting the number of items expired from the cache in a single run, dealing with a manageable chunk each time.

You can configure the number of items deleted in a single run by setting the $conf['safe_cache_form_clear_limit'] persistent variable.

More detail is available on this core issue.

Successful Deployments

http://www.nbcolympics.com/
http://www.bbcgoodfood.com/
https://store.bbc.com/

FAQ

How frequently should I run the command and how many items should I purge each run?

This depends on your Drupal site, your hosting infrastructure and the number of authenticated users you serve. You can make sensible decisions about the configuration by repeatedly running this command: time drush safe-cache-form-clear with different values for the limit.

If you wish to be cautious you can run this command out of hours, e.g. Run it every minute from 1.00 AM until 6.00 AM

Do I have any other options?

[1] Use a persistent storage service specifically designed for key value operations such as Redis, MongoDB or CouchDB.

[2] TRUNCATE the cache_form table out of hours. Users who had a valid form token will receive an error message about the form being outdated when they attempt to submit it. See drupal_validate_form().

Development of this module was funded by BBC Worldwide.

Project information

  • caution Seeking new maintainer
    The current maintainers are looking for new people to take ownership.
  • caution No further development
    No longer developed by its maintainers.
  • chart icon534 sites report using this module
  • Created by alanmackenzie on , updated
  • shieldStable releases for this project are covered by the security advisory policy.
    Look for the shield icon below.

Releases