Website load optimization for different regions using edge computing

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

Website Load Optimization for Different Regions (Edge Computing)

Edge Computing transfers part of the calculations from the central server to CDN edge nodes. Instead of every request traveling to the data center in Moscow, it's processed on the nearest Edge node to the user — in Novosibirsk, Berlin, or Tokyo.

What can run on Edge

Task Edge Solution Provider
A/B tests Cloudflare Workers Cloudflare
Locale detection and redirects Edge Middleware Vercel, Cloudflare
Geo-based personalization Workers KV Cloudflare
JWT authorization Edge Functions Cloudflare, Netlify
Static page SSR Durable Objects Cloudflare
Image optimization Image Resizing Cloudflare Pro

Cloudflare Workers: geo-personalization

// workers/geo-personalization.js
export default {
  async fetch(request, env) {
    const country = request.cf.country;
    const city    = request.cf.city;

    // Get response from origin
    const response = await fetch(request);
    const html     = await response.text();

    // Substitute regional content
    const personalized = html
      .replace('{{COUNTRY}}', country)
      .replace('{{SHIPPING_NOTICE}}', getShippingNotice(country))
      .replace('{{CURRENCY}}', getCurrency(country));

    return new Response(personalized, {
      headers: response.headers,
      status:  response.status,
    });
  }
};

function getShippingNotice(country) {
  const notices = {
    'RU': 'Free shipping in Russia from 3,000 ₽',
    'DE': 'Free shipping from €50',
    'US': 'Free shipping on orders over $50',
  };
  return notices[country] ?? 'Free international shipping';
}

Vercel Edge Middleware: redirects and localization

// middleware.ts (Next.js)
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';

export function middleware(request: NextRequest) {
  const url = request.nextUrl.clone();

  // Geo-based language redirect
  const country  = request.geo?.country ?? 'US';
  const locale   = countryToLocale(country);

  if (url.pathname === '/') {
    url.pathname = `/${locale}`;
    return NextResponse.redirect(url, { status: 302 });
  }

  // Edge A/B testing
  const bucket = request.cookies.get('ab_bucket')?.value
    ?? (Math.random() < 0.5 ? 'a' : 'b');

  const response = NextResponse.next();
  response.cookies.set('ab_bucket', bucket, { maxAge: 86400 * 30 });
  response.headers.set('X-AB-Bucket', bucket);

  return response;
}

export const config = {
  matcher: ['/', '/(ru|en|de|fr)/:path*'],
  runtime: 'edge',  // executes on Edge, not on Node.js server
};

Edge KV Storage: regional data cache

Cloudflare Workers KV is a global key-value store with replication to all Edge nodes. Read latency < 1ms:

// Cache pricing data by region
async function getRegionalPricing(country, env) {
  const cacheKey = `pricing:${country}`;
  const cached   = await env.PRICING_KV.get(cacheKey, 'json');

  if (cached) return cached;

  // Request from origin
  const pricing = await fetch(`https://api.example.com/pricing?country=${country}`)
    .then(r => r.json());

  // Cache for 1 hour
  await env.PRICING_KV.put(cacheKey, JSON.stringify(pricing), { expirationTtl: 3600 });

  return pricing;
}

Durable Objects: SSR on Edge

For sites with SSR (Next.js, Nuxt, Remix), Cloudflare Pages + Workers allows running server-side rendering on Edge nodes without a central server:

User (Tokyo) → Cloudflare Edge Tokyo
                    ↓ SSR here, not in Moscow
               Rendered HTML → User

TTFB latency reduces from 300–500ms to 50–80ms for users in regions.

Metrics to measure effectiveness

Before and after implementing Edge optimization:

  • TTFB (Time to First Byte) — key metric, should decrease
  • FCP (First Contentful Paint) — affects perceived speed
  • Core Web Vitals by region in Google Search Console

Measurement tools

# Measure TTFB from different regions via curl
curl -w "\nTTFB: %{time_starttransfer}s\nTotal: %{time_total}s\n" \
  -o /dev/null -s https://example.com

# Or via WebPageTest with region
# https://www.webpagetest.org — select Test Location: Moscow, Frankfurt, Singapore

Timeline

Basic Edge optimization (redirects, geolocation via Cloudflare Workers): 3–5 days. SSR migration to Edge (Cloudflare Pages + Workers): 10–15 days.