Skip to content
View proxycaching's full-sized avatar

Block or report proxycaching

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
proxycaching/README.md
proxycaching logo

ProxyCaching

Stop waiting for the same API call. Again.

A local HTTP/HTTPS caching proxy for developers — first request hits the real API,
every next identical request is served from local cache instantly.

License Issues Node TypeScript

Get started · Examples · Configuration · Admin UI · Report a bug


Why proxycaching?

Every developer knows the pain:

  • Slow external APIs making every test run take forever
  • Paid API quotas burning through during development (OpenAI, Stripe, etc.)
  • Flaky or rate-limited services breaking your local workflow
  • Same request, hundredth time — because you restarted the dev server again

proxycaching sits between your app and the internet. First call goes through normally. Every identical call after that? Served from local cache in milliseconds — no network, no cost, no waiting.


Features

  • HTTP & HTTPS caching — full MITM support for HTTPS traffic
  • Disk-backed cache — persists between restarts, readable only on your machine
  • Rule engine — cache only what you want (by domain, path, method, and more)
  • Admin UI — browser-based panel to inspect cached requests, hit counts, and timestamps
  • Encryption — optional on-disk encryption for cached responses
  • Zero config to start — sensible defaults, configure only what you need

Get started

npm install
npm run build
npm run start

That's it. Your caching proxy is running on :8080 and the admin UI is on :8081.

Test it:

# First call — hits the real API
curl --proxy http://localhost:8080 https://api.example.com/data

# Second call — served from cache instantly ⚡
curl --proxy http://localhost:8080 https://api.example.com/data

Open the admin UI to see what was cached: http://localhost:8081


Examples

Real-world usage examples are in the /examples directory:

Example Description
anthropic-ai-sdk Cache OpenAI / Anthropic API calls — stop paying for the same prompt twice
node.js-fetch Drop-in with native Node.js fetch

Admin UI

The built-in admin panel lets you:

  • Browse all cached requests with timestamps and hit counts
  • Inspect request and response details for each cached entry
  • Manage cache rules in real time with rule editors and grouping options
  • View proxy health at a glance with status cards and cache metrics
  • Export or install the MITM CA certificate

The new admin UI includes:

  • A modern dashboard with server status, uptime, cache entries, cache size, and MITM CA controls
  • Tabbed views for the cache store and cache rules
  • Search and refresh controls for the cache store list
  • Cache entry details modal showing request headers, request body, response metadata, hit count, and delete action
  • Rule editor modal for creating and updating rules by method, domain, path, headers, query params, and body pattern

Cache Store View

The main cache store screen shows all cached request keys with method, URL, hit count, and last access time. Use the search field and refresh button to quickly locate entries.

Cache Store View

Cache Entry Details

Click any cache row to open a detailed modal with request headers, request body, response metadata, hit count, and a delete action.

Cache Entry Details

Cache Rules View

The rules list displays active cache rules, including method, domain, paths, header filters, query filters, and grouping mode.

Cache Rules View

Cache Rule Editor

The editor modal allows fine-grained rule creation and updates with method selection, domain/path matching, required headers, query parameters, and body pattern support.

Cache Rule Editor

Available at http://localhost:8081 when proxy.adminEnabled is true.


Configuration

Configure via config/config.json. All settings are optional — defaults work out of the box.

{
  "proxy": {
    "port": 8080,
    "adminPort": 8081,
    "adminEnabled": true,
    "mitmEnabled": false,
    "podcachePath": "config/podcache",
    "encryption": {},
    "logging": {
      "level": "info"
    }
  }
}
Setting Default Description
proxy.port 8080 Port for the proxy listener
proxy.adminPort 8081 Port for the admin UI
proxy.adminEnabled true Enable or disable the admin server
proxy.mitmEnabled false Enable HTTPS interception and caching
proxy.podcachePath config/podcache Where cached responses are stored
proxy.encryption {} Optional on-disk encryption settings
proxy.logging.level info Logging verbosity

HTTPS caching (MITM mode)

By default, HTTPS traffic is proxied as an opaque tunnel and not cached. To cache HTTPS:

  1. Set proxy.mitmEnabled: true in config/config.json
  2. Start the proxy — it will generate a local CA certificate under config/mitm/proxy-ca/
  3. Install the CA certificate into your OS trust store (or use the Admin UI → CA Install)
  4. Restart your browser or HTTP client
# Or install via Admin API
curl -X POST http://localhost:8081/ca-install

Warning

MITM mode decrypts HTTPS traffic locally. Only use this on your own machine during development.


Admin API

For scripting and automation:

Endpoint Description
GET /config Current proxy config and rules
GET /rules List of cache rules
GET /cache All cached entries
GET /cache/:key Details for a specific cached entry
GET /status Runtime health and diagnostics
GET /ca-info CA fingerprint and trust status
POST /ca-install Install the CA into the OS trust store
GET /ca-export Download the CA certificate

Development mode

Run directly from TypeScript source (no build step needed):

npm run dev

Troubleshooting

CA certificate is missing

Start the proxy and let it generate the CA files in config/mitm/proxy-ca/ before attempting to install or export.

Untrusted certificate errors in browser

Install the CA certificate into your OS trust store via the Admin UI or POST /ca-install, then restart your browser.

HTTPS traffic not being cached
  • Confirm proxy.mitmEnabled is true
  • Confirm the CA is installed and trusted by your OS
  • Check your cache rules in config/config.json
  • Inspect proxy logs for cache decision details

License

Free for personal and open-source use. Commercial use (any for-profit company, even internal tools) requires a paid license.

→ Read the full license → Commercial licensing: proxycaching@interia.pl


Popular repositories Loading

  1. proxycaching proxycaching Public

    Proxy Caching Server is a lightweight developer tool designed to capture, cache, and replay HTTP and HTTPS traffic locally.

    TypeScript 1