Home โ€บ Guides โ€บ Hosting & Speed

How to Improve Speed & Security of a Porn Website Using a CDN

A CDN sits between your visitors and your server. It caches pages and files close to visitors, hides your server’s IP, absorbs bots and DDoS attacks, and gives you free TLS. For an adult site it’s close to mandatory. Here is how to set one up without the side effects that bit us.

Basic setup (Cloudflare example)

  1. Add the domain to Cloudflare and change the nameservers at your registrar.
  2. Delete any parking records your registrar created (they point to the registrar’s parking page).
  3. Create A records for the root and www pointing to your server, with the proxy (orange cloud) on.
  4. Create a free Origin CA certificate (valid up to 15 years), install it on your server, and set SSL mode to Full (strict).
  5. Turn on “Always use HTTPS” and redirect www to the root (or the other way round) on the server.

Cache the right things

Browser Cache TTL overrides your server. Cloudflare’s Browser Cache TTL setting replaces the Cache-Control header your server sends. We spent hours wondering why a fixed stylesheet stayed broken: the CDN told browsers to keep the old one for 4 hours. New file names solve it permanently.

Security without blocking search engines

Measure

Check response times as a crawler sees them, not only in your browser. Yandex flags sites with slow average response times. Watch your server’s response time for bot requests, and the CDN’s cache hit rate. A page that answers in 50 ms from cache and 3 seconds uncached is a slow page for most crawlers.

Common mistakes

Spotted something outdated, or run a service we should look at? Email [email protected]. Listings are never paid.