CDN setup with regional points of presence

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1212
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    852
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    815

CDN with Regional Points of Presence

CDN (Content Delivery Network) caches static resources on servers worldwide. User in Vladivostok gets image from server in Novosibirsk or Tokyo — not from Moscow. TTFB difference — hundreds of milliseconds.

Choosing CDN Provider

Provider PoP in CIS Features
Cloudflare Moscow, Kyiv, Almaty Free basic plan, WAF
Gcore 10+ points in CIS Best Russia coverage
AWS CloudFront Moscow S3 integration, Lambda@Edge
Bunny CDN Moscow Cheap, simple
VK Cloud CDN CIS For Russian traffic

Cloudflare CDN Setup

After connecting domain to Cloudflare, set up caching:

Page Rules for static:

URL: *.example.com/assets/*
Cache Level: Cache Everything
Edge Cache TTL: 1 month
Browser Cache TTL: 1 week

Cloudflare Cache Rules (new interface):

Field: URI Path
Operator: starts with
Value: /assets/

Action: Cache eligibility → Eligible for cache
Cache TTL: 30 days

AWS CloudFront Setup

{
  "Origins": [{
    "DomainName": "example.com",
    "Id": "origin-1",
    "CustomOriginConfig": {
      "HTTPSPort": 443,
      "OriginProtocolPolicy": "https-only"
    }
  }],
  "DefaultCacheBehavior": {
    "TargetOriginId":       "origin-1",
    "ViewerProtocolPolicy": "redirect-to-https",
    "CachePolicyId":        "658327ea-f89d-4fab-a63d-7e88639e58f6"
  },
  "CacheBehaviors": [{
    "PathPattern":    "/assets/*",
    "TargetOriginId": "origin-1",
    "CachePolicyId":  "CACHING_OPTIMIZED_POLICY_ID",
    "Compress":       true
  }]
}

Proper Cache Headers on Server

CDN respects origin server headers. Nginx config:

location ~* \.(js|css|woff2|png|jpg|webp|svg)$ {
    expires     1y;
    add_header  Cache-Control "public, immutable";
    add_header  Vary "Accept-Encoding";
}

location ~* \.html$ {
    expires     1h;
    add_header  Cache-Control "public, must-revalidate";
}

immutable tells browser: don't do conditional request even on page reload. Works with content-hashed filenames (app.a1b2c3.js).

Cache Invalidation

On new code deployment invalidate CDN cache:

# Cloudflare
curl -X POST "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/purge_cache" \
  -H "Authorization: Bearer $CF_TOKEN" \
  -d '{"purge_everything":true}'

# AWS CloudFront
aws cloudfront create-invalidation \
  --distribution-id $DIST_ID \
  --paths "/assets/*"

In CI/CD pipeline invalidation runs automatically after deploy.

Timeline

CDN setup with caching configuration and auto-invalidation on deploy: 1–2 working days.