cloudflare / cloudflare/cloudflare-docs

PHP example of Siteverify validation extremely slow in production environment

Open
#30,713 1 comment 0 reactions 2 assignees Claimed by @punkeel View on GitHub
content:edit documentation product:turnstile stale
Dominant language
MDX
Stars
5.2k
Forks
16.7k
Avg merge
2d 6h
Merged PRs (30d)
337

Description

### Existing documentation URL(s)

https://developers.cloudflare.com/turnstile/get-started/server-side-validation/

### What changes are you suggesting?

The PHP example of this guide is using file_get_contents to get the response of the Siteverify challenge. In my case, this worked fine with local testing, but was consistently incredibly slow in production (4-6s response time).

I suggest you replace it with cURL.

### Additional information

My measurements:

[2026-05-10 06:10:45] (ERROR @ xxxxx) Turnstile validation completed in 4137.67ms (HTTP request: 4137.65ms)
[2026-05-10 06:24:23] (ERROR @ xxxxx) Turnstile validation completed in 265.73ms (HTTP request: 265.71ms)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.