Text and data

How to Preview Cloudflare Pages Header Rules Before Deployment

Inspect a proposed configuration before changing a deployment. Cloudflare Pages _headers Validator explains local rule matching while keeping response-generation assumptions visible.

Header configuration and representative URLs reviewed locally before checking actual deployed responses
Inspect matching rules locally, then verify representative deployed responses.

Choose representative URLs

Choose a small set of URLs that exercise the actual rule boundaries: a page, an asset, a nested route and any host-specific pattern. Keep a record of the response source for each. A path that looks like a static file may still be handled by application code, so confirm the routing configuration with the owner of that deployment.

Read every matching declaration

Review the declaration lines together rather than treating the preview as an explanation of browser behaviour. A repeated header can have a different meaning from a simple replacement. Review removals alongside additions, and confirm that a combined value makes sense for the particular header. Syntax checks cannot decide whether a security policy is appropriate for your application.

Keep the original file and make narrow corrections in a working copy. For a host placeholder, test both a matching host and a non-matching host. For a path wildcard, include a boundary case that should not receive the declaration. This turns the preview into a repeatable review rather than a single reassuring example.

Inspect the deployed response

Use the findings report to explain the proposed correction in code review. Deploy through your normal process, then inspect the actual response for each representative URL. Account for routing, caching and application-generated headers. If the result differs from the preview, start with the response source and deployed build output. The tool neither fetches the URL nor certifies policy enforcement.

References

Use the linked specifications and product documentation to check behavior in your own environment.

Continue troubleshooting

Related tools

Frequently asked questions

Does the preview request my URL?

No. It matches URL text against the supplied file entirely locally.

Can this certify a security policy?

No. Configuration syntax and URL matching do not establish browser policy enforcement.

Should I test more than one URL?

Yes. Use representative paths and hosts that exercise both matching and non-matching cases.

Need help with a tool or found a bug?

Report an issue directly to engineering. No accounts required — all client data remains private on your device.

Report an Issue →