Cloudflare pagecache caches recaptcha

#1
Hello,

My litespeed server uses recaptcha now and then but when I also use Cloudflare pagecache (cache evrerything) it doesn't work. Looks like the recaptcha gets cached and it's impossible to get past it. Can I prevent Cloudflare from caching the recaptcha?

Regards,
Mark
 

abk

Administrator
Staff member
#2
Is the website a WordPress one using LiteSpeed Cache for WordPress Plugin? Please share with us more details on the setup and the application.
 
#3
I am on a shared hosting server and this happens with plain html, wordpress with and without the lscache plugin. So I think its the litespeed server that puts up the recaptcha and then cloudflare caches that page. So the next time someone visits that specific page(s) he gets the (page)cached recaptcha page from cloudflre cache and not the original from the server. Because the page is cached it's impossible to to get get past that recaptcha to see the content but other pages are fine. Is there a way to identify the recaptcha page to make a bypass caching rule in cloudflare? I have tried cookies to make an exception rule but that only works for the specific page.
 
#4
I am on a shared hosting server and this happens with plain html, wordpress with and without the lscache plugin. So I think its the litespeed server that puts up the recaptcha and then cloudflare caches that page. So the next time someone visits that specific page(s) he gets the (page)cached recaptcha page from cloudflre cache and not the original from the server. Because the page is cached it's impossible to to get get past that recaptcha to see the content but other pages are fine. Is there a way to identify the recaptcha page to make a bypass caching rule in cloudflare? I have tried cookies to make an exception rule but that only works for the specific page.

Is the website a WordPress one using LiteSpeed Cache for WordPress Plugin? Please share with us more details on the setup and the application.

Hi both, I had to create an account because I finally across a post from someone with the exact same problem we are facing with our website.

We are having the EXACT same problem
1) We are using Hostinger and Cloudflare
2) Cloudflare is caching the recaptcha page
3) Infinite loop until cache is cleared

I have tried many things to solve this but considering leaving hostinger/Litespeed but this would be a monumental task.

Things we have tried like mark

1) tried cookie based bypass and did not work
2) no query strings to use as a rule

set up: no ls-cache plugin, we are using WP-Rocket, Hostinger and cloudflare.

Is there anything that can be done to solve this issue? Cloudflare could not help either
 
#6
Yes it's a problem I did not experience before. This is my first time on a Litespeed server and also on Hostinger. For the Wordpress websites I think I solved it by using the Litespeed plugin for the pagecache settings and I changed the Cloudflare cache rule settings to:

-Eligible for cache
- Use cache-control header if present, cache request with Cloudflare's default TTL for the response status if not.
- Respect origin TTL
- If on, Cloudflare will not serve stale content while getting the latest content from the origin.

Maybe you can do the same with the WP-Rocket plugin. I think the recaptcha rule has a no-cach header and will not be cached by Cloudflare. Hope this helps you too.

Regards,
Mark
 
Top