You're using Call-to-action forms, for example great Webforms on many Drupal 8+ (9 / 10 / ...) pages and you're wondering why your pages are slow and eventually not cached?
While placing CTA-forms on pages can be a very good idea for conversions, the CAPTCHAs and other spam-prevention methods used can kill your Drupal cache!
I won't go into details here and only link some of the issues (please help to find better solutions there), but there are reasons, why some spam prevention methods don't work with cache! (And others do!):
- https://www.drupal.org/project/captcha/issues/3311447 (planning to fix this using AJAX)
- https://www.drupal.org/project/honeypot/issues/2820400 (planning to fix this using AJAX)
So as written above, please help to improve the situation in these issues
As of 2022-09 I found the following:
Page / render cache killing spam protection modules:
- CAPTCHA: Image, Math
Non Cache-killing Spam protection modules:
- riddler (CAPTCHA contrib module) - With one question! (>1 disables cache)
How to check if cache is hit?
There are some ways to check if cache is hit. One can be found in this very interesting article: https://alvinalexander.com/source-code/how-test-drupal8-pages-cached-ca…
curl -I https://www.example.com
in your bash and check if
x-cache-status: HIT is present. Better call it 2x, if your cache may have been cold before, to be sure you get the correct results. The first call warms the cache then, the second can tell you, if caching works!
Drupal 9.5 introduces a setting for easier cache debugging, read more about it in this change-record: https://www.drupal.org/node/3162480
Please help to implement https://www.drupal.org/project/icon_captcha for more privacy and removing the need to use reCaptcha! :)