Cloudflare Basics

Cloudflare CDN, DNS, and security features.

DNS Records

# A Record
Type: A
Name: @ # or subdomain
IPv4: 192.0.2.1
Proxy: ON # orange cloud

# CNAME Record
Type: CNAME
Name: www
Target: example.com

Page Rules

# Cache Everything
URL: example.com/static/*
Setting: Cache Level = Cache Everything

# Force HTTPS
URL: http://*example.com/*
Setting: Always Use HTTPS = ON

Firewall Rules

# Block country
Field: Country
Operator: equals
Value: CN
Action: Block

# Challenge bad bots
Field: Threat Score
Operator: greater than
Value: 10
Action: Challenge

Cache Settings

# Browser Cache TTL
4 hours # how long browsers cache

# Edge Cache TTL
2 hours # how long Cloudflare caches

# Cache Level
Standard # cache static content
Aggressive # cache more content