Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
image_captcha path is generated by code:
$img_src = check_url(url("image_captcha/$captcha_sid/" . REQUEST_TIME));
For every generated captcha image, there will be executed menu_get_item() function, which will cache router item for every $img_src path;
$cid = 'menu_item:' . hash('sha256', $path);
cache_set($cid, $router_item, 'cache_menu');
Of course these menu_item cached records will never be reused. On high traffic pages cache_menu table grew over 800Mb.
Solution can be simple:
$img_src = check_url(url("image_captcha/$captcha_sid/", array( 'query' => array('ts' => REQUEST_TIME) )));
Comment | File | Size | Author |
---|---|---|---|
#1 | 1442746-fix_cache_menu_overflowing-1.patch | 1.57 KB | Mark Theunissen |
Comments
Comment #1
Mark Theunissen CreditAttribution: Mark Theunissen commentedUnfortunately, the captcha session id $captcha_sid also increments, so moving the timestamp out of the call is not enough. You'll need to move the $captcha_sid out, too.
Patch attached. I haven't tested on all browsers.
Comment #2
soxofaan CreditAttribution: soxofaan commentedslightly tweaked and committed: http://drupalcode.org/project/captcha.git/commit/43bcbed
sorry for the delay