Loading...

CDN.com.tr Help

Cache, security, WAF, and purge

Use this section when content is stale, traffic is blocked, a redirect is unexpected, or a purge needs status tracking.

Cache, security, WAF, and purge

This section covers how the CDN stores, protects and refreshes your content — the three things that decide whether visitors get a fast, safe and up-to-date site. Cache rules control what is cached and for how long, security controls and the WAF filter out malicious traffic, and purge clears cached content the moment you publish a change.

Caching is what makes a CDN fast: a cached response is served from the edge, close to the visitor, without touching your origin server. You shape it with cache rules — the cache key, TTL, which HTTP methods and status codes to cache, and header/cookie handling — and you confirm it is working by reading the X-Proxy-Cache-MT response header, which shows HIT, MISS, BYPASS or EXPIRED for every request.

Security runs at the same edge. The WAF (Web Application Firewall) blocks common attacks such as SQL injection and cross-site scripting before they ever reach your server, and the WAF logs let you see exactly what was blocked or challenged and why. When content looks stale after an update, a purge removes the old copy from the edge cache so the next visitor gets the new version immediately.

Use cases

  • A customer updates CSS but sees old content.
  • A WAF event blocks legitimate traffic.
  • A redirect loop appears after a rule change.

Workflow

  1. Select account.
  2. Open Domains & Rules or Purge.
  3. Change only the relevant rule/action.
  4. Apply changes or watch purge status.

Checks

  • Rule belongs to selected account.
  • Purge path is valid.
  • WAF log filters match the selected account/time range.

Topics

Block traffic by ASN and by country

Two account-wide blacklists on the same panel: block whole countries by country code, or block whole networks by autonomous system number. A blocked visitor gets the branded 403 page with a Reference ID.

Restrict a path with a password or an IP allow list

Close a staging site, an admin area or a private folder at the edge: on a delivery rule, ask for a username and password, let only the IP addresses you list through, or both. Requests that do not pass are answered by the edge and never reach your server.

Turn on HSTS for your hostnames

The Always HTTPS (HSTS) switch makes the edge send Strict-Transport-Security: max-age=31536000 on HTTPS responses, so a browser that has seen your site once refuses to open it over plain HTTP for a year.

Write a rule for a domain and path

On the Rules tab of Domains & Rules, a rule picks requests by domain, protocol and path, then sets how they are cached, which headers are added or removed, where they are fetched from and who may open them.

Read WAF logs

Use WAF logs to see which requests were blocked or challenged, and why.

WAF log-only mode: try the rules before they block

Put the WAF in log-only mode for the whole site or for the paths you choose, for 7, 14 or 30 days. The WAF rules keep inspecting every request and write the ones they would have blocked to the logs as "would have been blocked", but block none of them. When the period ends, the account goes back to blocking by itself.

Purge cached content

Purge a path, saved path, or the whole account and separate CDN cache from browser cache.

Signed URLs: links that expire

Protect a file so it can only be fetched with a signature you generate, valid until a moment you choose. Unsigned requests get 403, expired ones get 410.

Image optimization: AVIF and WebP at the edge

Switch on image optimization for the account or for one delivery rule and choose WebP or WebP + AVIF: the edge converts JPEG and PNG images and sends each browser a format it accepts, while your pages keep the same image URLs.

Redirect a domain to another domain (301)

Send requests for a domain to another domain with a permanent (301) redirect from the Redirects tab of Domains & Rules. The path and query string are kept, and Auto SSL certificate checks under /.well-known keep working.

Brotli and gzip compression

The edge compresses text responses automatically: Brotli for browsers that support it, gzip for the others. See which method each domain uses on the Compression card and confirm it with curl.

HTTP/3 (QUIC): turn it off for a hostname

HTTP/3 is on for every HTTPS hostname by default. Turn it off for one hostname in its details on the Domains tab of Domains & Rules when its visitors, or a network they use, have trouble with QUIC; those visitors then use HTTP/2.

CORS headers at the edge

Add Access-Control-Allow-Origin and the other CORS headers to a delivery rule's responses, let your origin answer preflight OPTIONS requests, and allow the methods your API uses in the WAF.