The easiest way to tackle this is with our country-based redirects. If you’re experiencing issues with users from China, you can redirect visitors from this country wherever you like – including to a 0 bytes page (to not impact your bandwidth usage) or off-site (say, to Google).
In a _redirects file, you can add the following line:
/* https://google.com 302! Country=cn
/* /blank 302! Country=cn
/* means all pages, the next part is a URL to send them to (you may want to upload a blank file to
blank.html if you want to keep them on-site),
302 implies this is temporary, the
! forces the redirect (without the force, visitors would only be redirected if the page on your site doesn’t exist. So, for your dilemma, you may want to use
302 and not
302! ) and then, the country is self-explanatory and uses international country codes.
I hope that this helps! Alternative solutions would/could involve a Netlify function but this will require a lot more engineering from you.