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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mark Theunissen’s picture

Priority: Minor » Normal
Status: Active » Needs review
Issue tags: +D7 stable release blocker
FileSize
1.57 KB

Unfortunately, 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.

soxofaan’s picture

Status: Needs review » Closed (fixed)

slightly tweaked and committed: http://drupalcode.org/project/captcha.git/commit/43bcbed

sorry for the delay