This actually applies to 3x versions as well.

If I have a webform block with a file component it will add 2 entries to the cache_form table every time a page using that webform block is viewed. I'm not sure if this is by design since this has made it through several versions but figured I should report it anyway. It was causing major issues on a site of ours since it was a high traffic site and the cache_form table would fill up eventually bogging down MySQL and causing the site to crash.

Comments

danchadwick’s picture

Sounds like two unrelated issues. Can you please make a second issue and remove the second issue from this one? That way we can track each one.

EDIT: Second issue was removed from the summary.

swickham’s picture

Title: Excessive Caching and Persistent Block » Excessive Caching
Issue summary: View changes
swickham’s picture

Done, second issue can be found here - https://www.drupal.org/node/2356549

danchadwick’s picture

Status: Active » Closed (works as designed)

I looked briefly at this. The File component uses ajax, and ajax requires form caching. See drupal_build_form

It appears that the cache expiration is 6 hours. You can increase your cron frequency, but depending upon the rate of additions, your cache may grow at an alarming rate.

I think the solution for you would be to use a multi-page form, where the file components is not on the first page. If you avoid ajax, the form and form_state won't be cached until the form is submitted.

This seems to a be a Drupal-wide issue, affecting modules such as FiveStar and Commerce.