446 字
2 分钟
Building a WinDbg Symbol Download Accelerator with CF Workers
TIP

This project is open-sourced at Tokisaki-Galaxy/cf-symbol-proxy. Feel free to give it a star!

WARNING

The Cloudflare Cache API requires a custom domain to function. The default *.workers.dev domains do not support persistent caching.

Say Goodbye to Slow WinDbg Loading: Why is it always so slow?#

Many Windows developers and security researchers have experienced WinDbg hanging while loading symbols. The Microsoft Symbol Server (msdl.microsoft.com) can be highly unstable in certain regions (like China), and downloading a single PDB file often takes an eternity.

I developed the cf-symbol-proxy project to build a lightweight symbol proxy using Cloudflare Workers. This significantly boosts download speeds and resolves symbol loading latency.

Why Choose Cloudflare Workers?#

  • Global Acceleration: Leverage Cloudflare’s edge nodes to process requests at the location closest to you.
  • Generous Free Tier: 100,000 free requests per day, which is more than enough for individual developers.
  • Edge Caching (Cache API): Symbol files (PDBs) are immutable. Once cached, subsequent downloads are nearly instantaneous.
  • Zero Maintenance: No need to buy servers or worry about DevOps.

Highlights#

Deeply optimized for the specific behaviors of the Microsoft Symbol Server:

  1. Fixing 0-byte Pollution: Microsoft servers often respond to HEAD requests with a 200 OK but empty content. The proxy forces the origin fetch to use GET to ensure the cache contains the complete file.
  2. Smart Caching: 200 OK responses are cached for one year, while 404 Not Found responses are cached for one hour to prevent WinDbg from frequently retrying missing files.
  3. Automatic Deployment: Integrated with GitHub Actions; code is automatically deployed upon pushing.
  4. Environment Decoupling: The upstream address can be configured via wrangler.toml, supporting various symbol sources.

Quick Deployment Guide#

You can directly fork my repository to launch your own proxy:

  1. (Optional) Fork the Repo: Visit Tokisaki-Galaxy/cf-symbol-proxy.
  2. Configure Auto-Build: In the Cloudflare Workers dashboard, create a new Worker, select GitHub as the source, connect to your repository, and set up automatic deployment.
  3. (Optional) Modify wrangler.toml: Change the upstream field to the symbol server address you wish to proxy.

Usage#

Once deployed, you simply need to set your symbol path in the Windows Environment Variables.

Variable Name: _NT_SYMBOL_PATH Variable Value:

srv*D:\Symbols*https://your-custom-domain.com

Technical Ramblings#

During implementation, I encountered a peculiar issue: The conflict between HEAD requests and cache keys.

The Cloudflare Cache API treats requests based on their HTTP method by default. If WinDbg sends a HEAD request to check if a file exists and the proxy script simply forwards it, Microsoft returns a 0-byte response. If this 0-byte response gets cached, subsequent legitimate GET requests for the download will also receive 0 bytes.

The solution was:

// Force the use of GET to construct the cache key
const cacheKey = new Request(url.toString(), { method: 'GET' });

By forcing the cache key to always use GET, we ensure that regardless of what the client sends, what we store in the edge node is always the actual file data.

Building a WinDbg Symbol Download Accelerator with CF Workers
https://tski.uk/blog/en/cf-symbol-proxy/
作者
Tokisaki Galaxy
发布于
2026-02-25
许可协议
CC BY