NewCode CLOUD — 20% off your first month on all cloud VPSClaim

Hong Kong VPS vs Cloudflare Workers: Which for Asia-Pacific APIs? (2026)

· 5 min read

Cloudflare Workers — serverless JavaScript running at Cloudflare’s 300+ global edge locations — sounds like it should deliver exceptional Asia-Pacific latency. But the reality for mainland Chinese users, persistent workloads, and data-intensive APIs is more nuanced. This comparison examines where each platform genuinely excels so you can match infrastructure to workload.


How Each Platform Works

Cloudflare Workers run JavaScript (or WASM) in V8 isolates at Cloudflare’s edge PoPs. Requests are served from the nearest PoP with no cold starts. Execution is limited to 10ms CPU time (free tier) or 30ms (paid), with no persistent file system, no long-running processes, and strict memory limits (128 MB).

Hong Kong VPS with CN2 GIA runs any language, any framework, any background process, with persistent disk storage, dedicated RAM, and a consistent CN2 GIA network path to mainland China that Cloudflare’s network does not replicate.


China Connectivity: The Critical Difference

Cloudflare operates PoPs in Hong Kong and several mainland Chinese cities (via their partnership with Chinese CDN providers). However, Cloudflare’s Chinese PoP coverage and CN2 GIA peering arrangements are not equivalent to a direct-hosted VPS with CN2 GIA.

Metric Cloudflare Workers (HK PoP) HK VPS (CN2 GIA)
TTFB from Shanghai (cached/edge) 15–40ms 5–20ms (FastCGI cache)
API response (dynamic, DB query) Not possible (no DB) 30–80ms
China routing consistency Variable (CDN routing) Consistent (CN2 GIA)
Peak-hour China performance Degrades (shared CDN) Stable (dedicated AS4809)
Workers in mainland China PoPs China plan only ($$$) N/A (HK is outside China)

Cloudflare Workers Pro/Business delivers good China performance for static or cached content — but dynamic API requests that require database access cannot run at the edge and must hit an origin server, negating the edge latency advantage.


Capability Comparison

Capability Cloudflare Workers Hong Kong VPS
Persistent file storage No (KV, R2 only) Yes (local NVMe)
Relational database D1 (limited SQLite) PostgreSQL, MySQL — full
Long-running background jobs No (30ms CPU limit) Yes — Celery, queues, cron
WebSocket connections Durable Objects (paid) Yes (Node.js/Python)
Custom runtimes JS/WASM/Python (beta) Any language
Memory per request 128 MB max Configurable (GB range)
Compute per request 30ms CPU max No limit
AI model inference Workers AI (limited models) Full GPU/CPU control
Self-hosted software No Yes (Gitea, Keycloak, etc.)
SSH access No Yes

Cost Comparison

Usage Pattern Cloudflare Workers Cost HK VPS Cost
10M requests/month ~$5/month (paid plan) Flat VPS fee (unlimited requests)
100M requests/month ~$50/month Same flat VPS fee
1B requests/month ~$500/month Possible VPS upgrade needed
KV storage (10 GB) ~$8/month Included in VPS NVMe
D1 Database (5 GB) ~$5/month Free (PostgreSQL on VPS)
R2 storage (100 GB) ~$1.50/month NVMe or MinIO on VPS

At low request volumes, Cloudflare Workers is extremely cost-competitive. At very high volumes (100M+ requests/month), a VPS is cheaper. The comparison inverts again for AI workloads where Cloudflare Workers AI costs per token while self-hosted inference has fixed hardware cost.


Where Cloudflare Workers Genuinely Wins

Global Edge Caching with Dynamic Rendering

For content that varies by geography but can be computed in under 30ms — localised pricing, geo-specific landing pages, A/B testing at the edge — Workers eliminates origin round-trips globally. A Hong Kong VPS origin with Workers in front delivers the best of both: VPS-hosted data with edge rendering everywhere.

Zero Infrastructure Management for Simple APIs

A simple API (currency conversion, weather aggregation, webhook proxy) that fits within Workers’ constraints deploys in minutes with no server configuration, no OS updates, no backup management. For a solo developer building a side project, the operational simplicity has real value.

DDoS Absorption

Cloudflare absorbs DDoS attacks at the CDN layer before traffic reaches your origin. A VPS behind Cloudflare proxy inherits this protection — but a VPS not behind Cloudflare is exposed to direct-IP attacks.

Global API Endpoints Without Multi-Region VPS

A Worker runs at 300+ PoPs simultaneously — European users get European-latency responses, US users get US-latency responses, and Asian users get Asian-latency responses from a single deployment. Achieving the same with VPS requires a multi-region architecture.


Where Hong Kong VPS Wins

Any Workload Requiring Persistence or Long Computation

Database-driven APIs, file processing, ML inference, video transcoding, background job processing — none of these fit within Workers’ execution model. A VPS handles all of them without constraint.

Consistent China Performance on Dedicated Infrastructure

CN2 GIA on a dedicated VPS provides consistent, guaranteed routing to mainland China that shared CDN infrastructure cannot match during peak hours when the CDN’s Chinese routes are congested.

Self-Hosted Software Stack

PostgreSQL, Redis, Gitea, Keycloak, MinIO, Prometheus — the entire self-hosted ecosystem runs on a VPS and cannot run on Workers. If you need any of these, the VPS is the foundation.

Predictable Costs at Scale

A 4 GB Hong Kong VPS handles 50M+ requests/month for a typical API with caching. At that scale, Workers Pro costs $50+/month versus a fixed flat VPS fee. For high-volume APIs, VPS wins on cost.


The Optimal Architecture: VPS + Workers Together

The highest-performing Asia-Pacific architecture uses both:


[Cloudflare Workers — Global Edge]
    ├── Cache static/semi-static responses at edge
    ├── Geo-specific logic (pricing, routing, localisation)
    ├── Rate limiting and bot filtering at CDN layer
    └── Pass dynamic requests to origin ↓

[Hong Kong VPS — CN2 GIA Origin]
    ├── PostgreSQL: authoritative data store
    ├── Redis: session and application cache
    ├── Application server: business logic
    └── Background workers: async processing
<code"># Cloudflare Worker as smart cache + router:
export default {
  async fetch(request, env) {
    const url = new URL(request.url);

    // Serve cached responses at edge for GET requests
    if (request.method === 'GET') {
      const cache = caches.default;
      let response = await cache.match(request);
      if (response) return response;

      // Cache miss — fetch from HK VPS origin
      response = await fetch(`https://api-origin.yourdomain.com${url.pathname}`, {
        headers: request.headers
      });

      // Cache successful responses for 60 seconds at edge
      if (response.ok) {
        const cacheResponse = response.clone();
        cacheResponse.headers.set('Cache-Control', 'max-age=60');
        event.waitUntil(cache.put(request, cacheResponse));
      }
      return response;
    }

    // POST/PUT/DELETE — always route to origin
    return fetch(`https://api-origin.yourdomain.com${url.pathname}`, {
      method: request.method,
      headers: request.headers,
      body: request.body
    });
  }
};

Decision Matrix

Workload Choose Reason
Simple stateless API, global users Workers Edge latency, no infra
Database-driven API, Asia primary HK VPS DB required, CN2 GIA
Static site + edge personalisation Workers + VPS origin Best of both
Self-hosted software stack HK VPS No alternative
Very high request volume (>100M/mo) HK VPS Cost advantage
China-consistent performance HK VPS (CN2 GIA) Dedicated routing
Webhook processor Workers Simple, near-zero cost
ML model serving (custom models) HK VPS (GPU) Custom models need VPS

Conclusion

Cloudflare Workers and a Hong Kong VPS are complementary tools, not competitors. Workers excels for stateless, globally-distributed, low-compute functions where edge distribution matters. A Hong Kong VPS with CN2 GIA excels for any workload requiring persistence, long computation, custom software, or guaranteed consistent China routing. For serious Asia-Pacific applications, the combination — Workers as a global cache and routing layer, HK VPS as the authoritative origin — delivers better performance than either alone.

Build your origin: Browse Server.HK Hong Kong VPS plans — the CN2 GIA origin that Cloudflare Workers routes to for dynamic content your edge layer cannot serve.

Related articles

More in VPS & ServersServer setup guides