KeyCDN Setup: Pull Zone, HTTPS, Caching & Integration

Static loading slow for European users? Origin server struggling under peak loads, TTFB climbing above 300 ms, and Core Web Vitals failing audits. For projects on Laravel, WordPress, or custom PHP, a typical issue is latency from remote infrastructure. We help set up KeyCDN—a European CDN with 35+ p

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:

Frequently Asked Questions

Latest works

  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1281
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1237
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    977
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    1025
  • image_website-sbh_0.webp
    Website development for SBH Partners
    1103
  • image_website-_0.webp
    Website development for Red Pear
    550

Static loading slow for European users? Origin server struggling under peak loads, TTFB climbing above 300 ms, and Core Web Vitals failing audits. For projects on Laravel, WordPress, or custom PHP, a typical issue is latency from remote infrastructure. We help set up KeyCDN—a European CDN with 35+ points of presence (PoPs), low latency, and pay-as-you-go pricing. After integration, TTFB drops to 30–50 ms, server load decreases by 85%, and cache hit rate reaches 98% with proper headers.

KeyCDN uses HTTP/2 and supports on-the-fly WebP conversion. We've connected it for 50+ sites—results are stable. Below we break down typical problems and the setup process.

Problems We Solve

  • High TTFB—requests travel thousands of kilometers. KeyCDN brings content closer to users (PoPs in Frankfurt, Amsterdam, London), reducing latency by 3–5x.
  • Origin overload—static files (CSS, JS, images) are served from the CDN, reducing server load by up to 80%.
  • No WebP support—KeyCDN converts images to WebP on the fly, without changing URLs (via the format=webp parameter).
  • Suboptimal caching—we set Cache-Control and Expires headers to maximize browser and CDN caching.

Pull Zone: How It Works

We use Pull Zones—KeyCDN fetches content from the origin on the first request. No rsync or FTP needed. For projects with already-uploaded files, Push Zones are suitable, but Pull is standard for dynamic sites.

Example of creating a Pull Zone via API:

curl -X POST \ -u api_key: \ -H "Content-Type: application/json" \ -d '{ "name": "example-assets", "type": "pull", "origins": [{"url": "https://example.ru"}], "ssl": true, "cors_headers": true, "cache_headers": true, "expire": 2592000, "custom_domains": ["cdn.example.ru"] }' \ https://api.keycdn.com/zones.json 

After creation, KeyCDN provides a CNAME (e.g., example-assets-1234.kxcdn.com). We add a CNAME record in DNS. SSL for the custom domain is issued automatically via Let's Encrypt.

Criteria Pull Zone Push Zone
Source Origin server (HTTP) Direct upload (rsync/FTP/API)
Update Automatic after invalidation Requires manual upload
Traffic Inbound + outbound Outbound only (cheaper)
Use case Dynamic sites Static files, archives

For 90% of projects, we choose Pull—minimal manual work.

How to Set Up HTTPS for a Custom Domain?

After adding a custom domain to the zone, KeyCDN automatically issues a certificate via Let's Encrypt. Just point a CNAME to the provided CDN domain and wait 1–5 minutes. No manual CRL or CSR. Important: for HTTPS, make sure your origin server also serves static files over HTTPS to avoid mixed content.

Why Cache Invalidation Is Critical

Without it, after updating files (e.g., app.css?v2), users see the old version. Invalidation clears specific URLs or the entire zone. We implement it via API: call DELETE /zones/purgeurl/{zoneId}.json with a URL array. In Laravel, this is wrapped in a service provider (see below). Cache hit rate drops to 0% without invalidation—critical for updates.

Integration with Laravel

Simple static asset redirection via a service provider:

// config/cdn.php return [ 'url' => env('CDN_URL', ''), 'enabled' => env('CDN_ENABLED', false), ]; // AppServiceProvider: override URL for assets public function boot(): void { if (config('cdn.enabled') && $cdnUrl = config('cdn.url')) { URL::forceRootUrl($cdnUrl); } } 

In templates, just use asset():

{{-- In templates -- }} <img src="{{ asset('images/logo.png') }}" alt="KeyCDN setup"> {{-- Outputs: https://cdn.example.ru/images/logo.png -- }} 

Cache invalidation—wrapper via API:

use Illuminate\Support\Facades\Http; class KeyCdnService { private string $apiKey; private string $zoneId; public function purge(array $urls): void { Http::withBasicAuth($this->apiKey, '') ->delete("https://api.keycdn.com/zones/purgeurl/{$this->zoneId}.json", [ 'urls' => $urls, ]); } public function purgeAll(): void { Http::withBasicAuth($this->apiKey, '') ->get("https://api.keycdn.com/zones/purge/{$this->zoneId}.json"); } } 

Origin Header Configuration

KeyCDN caches what the origin sends. Proper headers on Nginx:

location /assets/ { expires 1y; add_header Cache-Control "public, max-age=31536000, immutable"; add_header Access-Control-Allow-Origin *; } 
Header Recommended value Purpose
Cache-Control public, max-age=31536000, immutable Long-term caching for immutable files
Expires 1y Expires after a year
Vary Accept-Encoding Support compression

To improve hit rate, use s-maxage and stale-while-revalidate for the CDN. Enable WebP via the ?format=webp parameter in zone settings.

Our Process

  1. Audit—analyze current metrics, identify static resources, check caching headers.
  2. Zone creation—set up Pull Zone, specify origin, enable HTTPS, CORS, custom domain.
  3. DNS—add CNAME record, wait for propagation (up to 30 minutes).
  4. SSL—KeyCDN automatically issues Let's Encrypt.
  5. Integration—plug CDN into code (Laravel, WordPress, any CMS), set up cache invalidation.
  6. Testing—verify caching accuracy, load speed, WebP.
  7. Monitoring—set up KeyCDN analytics (traffic, cache hit rate, status codes).

What's included: integration documentation (code, commits), access to KeyCDN panel, API keys, team training on cache and invalidation, 30-day technical support.

Timelines and Guarantees

Basic setup—2 to 4 hours from access provision. Complex projects (custom origins, multiple zones)—up to 2 days. Pricing is individualized. 5+ years of experience, 50+ projects delivered—we guarantee stable operation and support. Contact us for a free audit of your current infrastructure. Get a consultation on KeyCDN setup.