<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Matias Salinas</title>
    <description>The latest articles on DEV Community by Matias Salinas (@msalinas92).</description>
    <link>https://dev.to/msalinas92</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3368314%2F3f251317-36e2-4feb-8472-e51568a67ae7.jpg</url>
      <title>DEV Community: Matias Salinas</title>
      <link>https://dev.to/msalinas92</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/msalinas92"/>
    <language>en</language>
    <item>
      <title>CacheBolt: Ultra-Fast Reverse Proxy &amp; Multicloud Cache for Modern Services</title>
      <dc:creator>Matias Salinas</dc:creator>
      <pubDate>Fri, 18 Jul 2025 20:15:40 +0000</pubDate>
      <link>https://dev.to/msalinas92/cachebolt-ultra-fast-reverse-proxy-multicloud-cache-for-modern-services-412o</link>
      <guid>https://dev.to/msalinas92/cachebolt-ultra-fast-reverse-proxy-multicloud-cache-for-modern-services-412o</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;A blazing-fast reverse proxy with intelligent caching and multi-backend object storage support.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🚀 Introduction
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;CacheBolt&lt;/strong&gt; is a high-performance reverse proxy designed to cache and serve responses with minimal latency. It intelligently stores responses in memory and synchronizes them with persistent object storage backends.&lt;/p&gt;

&lt;p&gt;This tool is ideal for accelerating APIs, file delivery, and improving reliability under high load.&lt;/p&gt;

&lt;h3&gt;
  
  
  📦 Downloads
&lt;/h3&gt;

&lt;p&gt;You can download the latest precompiled binaries for your platform from the &lt;a href="https://github.com/msalinas92/CacheBolt/releases/latest" rel="noopener noreferrer"&gt;latest GitHub release&lt;/a&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Platform&lt;/th&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;macOS (Apple Silicon)&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/msalinas92/CacheBolt/releases/latest/download/cachebolt-aarch64-apple-darwin.tar.gz" rel="noopener noreferrer"&gt;&lt;code&gt;cachebolt-aarch64-apple-darwin.tar.gz&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;macOS (Intel)&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/msalinas92/CacheBolt/releases/latest/download/cachebolt-x86_64-apple-darwin.tar.gz" rel="noopener noreferrer"&gt;&lt;code&gt;cachebolt-x86_64-apple-darwin.tar.gz&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Linux (ARM64)&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/msalinas92/CacheBolt/releases/latest/download/cachebolt-aarch64-unknown-linux-gnu.tar.gz" rel="noopener noreferrer"&gt;&lt;code&gt;cachebolt-aarch64-unknown-linux-gnu.tar.gz&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Linux (x86_64, musl)&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/msalinas92/CacheBolt/releases/latest/download/cachebolt-x86_64-unknown-linux-musl.tar.gz" rel="noopener noreferrer"&gt;&lt;code&gt;cachebolt-x86_64-unknown-linux-musl.tar.gz&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Windows (x86_64)&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/msalinas92/CacheBolt/releases/latest/download/cachebolt-x86_64-pc-windows-gnu.zip" rel="noopener noreferrer"&gt;&lt;code&gt;cachebolt-x86_64-pc-windows-gnu.zip&lt;/code&gt;&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;CacheBolt reads its configuration from a YAML file. By default, it expects a file config.yaml:&lt;/p&gt;

&lt;p&gt;Default mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./cachebolt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Custom config path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./cachebolt &lt;span class="nt"&gt;--config&lt;/span&gt; ./config/prod.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Docker:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;--rm&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; 3000:3000 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;/config:/config &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;/cache:/data &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="nv"&gt;GOOGLE_APPLICATION_CREDENTIALS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/config/adc.json &lt;span class="se"&gt;\&lt;/span&gt;
  ghcr.io/msalinas92/cachebolt:latest &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--config&lt;/span&gt; /config/config.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ✨ Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🔁 Reverse HTTP proxy powered by &lt;a href="https://github.com/tokio-rs/axum" rel="noopener noreferrer"&gt;Axum&lt;/a&gt; and &lt;a href="https://tokio.rs/" rel="noopener noreferrer"&gt;Tokio&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🚀 Fast, concurrent in-memory caching with LRU eviction&lt;/li&gt;
&lt;li&gt;☁️ Multi-cloud object store support:

&lt;ul&gt;
&lt;li&gt;🟢 Amazon S3&lt;/li&gt;
&lt;li&gt;🔵 Google Cloud Storage&lt;/li&gt;
&lt;li&gt;🔶 Azure Blob Storage&lt;/li&gt;
&lt;li&gt;💽 Local filesystem&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;📉 Memory-based cache eviction (threshold-configurable)&lt;/li&gt;

&lt;li&gt;⏱️ Latency-based failover policies (regex route rules)&lt;/li&gt;

&lt;li&gt;🧠 Smart fallback if upstreams are slow or unavailable&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  🖥️ Web UI (Built-in Admin Interface)
&lt;/h2&gt;

&lt;p&gt;CacheBolt comes with a built-in &lt;strong&gt;graphical admin interface&lt;/strong&gt; accessible via your browser.&lt;br&gt;&lt;br&gt;
This lightweight UI is bundled directly into the binary—no additional server or frontend hosting is required.&lt;/p&gt;
&lt;h3&gt;
  
  
  🔗 Accessing the UI
&lt;/h3&gt;

&lt;p&gt;Once CacheBolt is running, open:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://localhost:3001/admin" rel="noopener noreferrer"&gt;http://localhost:3001/admin&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  🧰 Available Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;🧠 &lt;strong&gt;View memory cache entries&lt;/strong&gt; in real time&lt;/li&gt;
&lt;li&gt;🧹 &lt;strong&gt;Clear in-memory or persistent cache&lt;/strong&gt; with a single click&lt;/li&gt;
&lt;li&gt;📊 &lt;strong&gt;Inspect memory usage, TTL, and sizes&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;🛠️ Fully static and bundled – served directly from the binary&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This interface is useful for both &lt;strong&gt;debugging&lt;/strong&gt; and &lt;strong&gt;administrative operations&lt;/strong&gt; in production environments.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg7tjz40ijz7tkmsudloq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg7tjz40ijz7tkmsudloq.png" alt="CacheBolt Web UI" width="800" height="580"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  🔁 Request Flow
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client sends GET request
        |
        v
┌────────────────────────────────────────────────────────┐
│            proxy_handler receives request              │
└────────────────────────────────────────────────────────┘
        |
        v
Check if URI is marked as degraded (should_failover)
        |
        ├── Yes --&amp;gt; try_cache(key)
        │            ├── Hit in memory? 
        │            │     └── ✅ Serve from memory
        │            ├── Else: Hit in storage?
        │            │     └── ✅ Load from selected storage backend (GCS, S3, Azure, or Local)
        │            │            └── Load into memory + Serve
        │            └── Else: ❌ Return 502 (no cache, no backend)
        │
        └── No
             |
             v
      Check MEMORY_CACHE for key
             |
             ├── Hit --&amp;gt; ✅ Serve from memory
             └── Miss
                  |
                  v
         Acquire semaphore (concurrency guard)
                  |
                  ├── Denied --&amp;gt; Check memory again
                  │               ├── Hit --&amp;gt; ✅ Serve
                  │               └── ❌ Return 502 (overloaded)
                  |
                  └── Acquired --&amp;gt; forward_request to backend
                                   |
                                   ├── Response latency &amp;gt; threshold?
                                   │         └── Yes --&amp;gt; mark_latency_fail
                                   |
                                   ├── Downstream OK?
                                   │         |
                                   │         ├── Build CachedResponse
                                   │         ├── In failover mode?
                                   │         │     ├── Yes --&amp;gt; Skip caching
                                   │         │     └── No:
                                   │         │           ├── Put in MEMORY_CACHE
                                   │         │           └── Send to CACHE_WRITER (persist to backend)
                                   │         └── ✅ Return response
                                   |
                                   └── Downstream failed --&amp;gt; try_cache fallback
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🔁 Probabilistic Cache Refreshing
&lt;/h2&gt;

&lt;p&gt;To ensure cached responses stay fresh over time, CacheBolt supports &lt;strong&gt;probabilistic refreshes&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
You can configure a percentage of requests that will intentionally bypass the cache and fetch a fresh version from the backend.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;refresh_percentage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the example above, approximately 1 in every 10 requests to the same cache key will bypass the memory and persistent cache and trigger a revalidation from the upstream server.&lt;br&gt;
The refreshed response is then stored again in both memory and persistent storage backends.&lt;/p&gt;

&lt;p&gt;This strategy helps:&lt;/p&gt;

&lt;p&gt;Keep long-lived cache entries updated&lt;/p&gt;

&lt;p&gt;Avoid cache staleness without needing manual invalidation&lt;/p&gt;

&lt;p&gt;Distribute backend load gradually and intelligently&lt;/p&gt;

&lt;p&gt;If set to 0, no automatic refresh will occur unless the cache is manually purged.&lt;/p&gt;


&lt;h2&gt;
  
  
  🔧 Configuration
&lt;/h2&gt;

&lt;p&gt;The config is written in YAML. Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="c1"&gt;# 🔧 Unique identifier for this CacheBolt instance&lt;/span&gt;
&lt;span class="na"&gt;app_id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-service&lt;/span&gt;

&lt;span class="c1"&gt;# 🌐 Port to bind the main proxy server (default: 3000)&lt;/span&gt;
&lt;span class="na"&gt;proxy_port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3000&lt;/span&gt;

&lt;span class="c1"&gt;# 🛠️ Port to bind the admin interface and /metrics (default: 3001)&lt;/span&gt;
&lt;span class="na"&gt;admin_port&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3001&lt;/span&gt;

&lt;span class="c1"&gt;# 🚦 Maximum number of concurrent outbound requests to the downstream service&lt;/span&gt;
&lt;span class="na"&gt;max_concurrent_requests&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;200&lt;/span&gt;

&lt;span class="c1"&gt;# 🌐 Base URL of the upstream API/backend to which requests are proxied&lt;/span&gt;
&lt;span class="na"&gt;downstream_base_url&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;http://localhost:4000&lt;/span&gt;

&lt;span class="c1"&gt;# 💾 Backend used for persistent cache storage&lt;/span&gt;
&lt;span class="c1"&gt;# Available options: gcs, s3, azure, local&lt;/span&gt;
&lt;span class="na"&gt;storage_backend&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;s3&lt;/span&gt;

&lt;span class="c1"&gt;# 🪣 Name of the Google Cloud Storage bucket (used if storage_backend is 'gcs')&lt;/span&gt;
&lt;span class="na"&gt;gcs_bucket&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cachebolt&lt;/span&gt;

&lt;span class="c1"&gt;# 🪣 Name of the Amazon S3 bucket (used if storage_backend is 's3')&lt;/span&gt;
&lt;span class="na"&gt;s3_bucket&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-cachebolt-bucket&lt;/span&gt;

&lt;span class="c1"&gt;# 📦 Name of the Azure Blob Storage container (used if storage_backend is 'azure')&lt;/span&gt;
&lt;span class="na"&gt;azure_container&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;cachebolt-container&lt;/span&gt;

&lt;span class="c1"&gt;# 🧠 Memory cache configuration&lt;/span&gt;
&lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="c1"&gt;# 🚨 System memory usage threshold (%) above which in-memory cache will start evicting entries&lt;/span&gt;
  &lt;span class="na"&gt;memory_threshold&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;

  &lt;span class="c1"&gt;# 🔁 Percentage of requests (per key) that should trigger a refresh from backend instead of using cache&lt;/span&gt;
  &lt;span class="c1"&gt;# Example: 10% means 1 in every 10 requests will bypass cache&lt;/span&gt;
  &lt;span class="na"&gt;refresh_percentage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;

&lt;span class="c1"&gt;# ⚠️ Latency-based failover configuration&lt;/span&gt;
&lt;span class="na"&gt;latency_failover&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="c1"&gt;# ⌛ Default maximum allowed latency in milliseconds for any request&lt;/span&gt;
  &lt;span class="na"&gt;default_max_latency_ms&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3000&lt;/span&gt;

  &lt;span class="c1"&gt;# 🛣️ Path-specific latency thresholds&lt;/span&gt;
  &lt;span class="na"&gt;path_rules&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;pattern&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;^/api/v1/products/.*"&lt;/span&gt;
      &lt;span class="na"&gt;max_latency_ms&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1500&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;pattern&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;^/auth/.*"&lt;/span&gt;
      &lt;span class="na"&gt;max_latency_ms&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1000&lt;/span&gt;

&lt;span class="c1"&gt;# 🚫 List of request headers to ignore when computing cache keys (case-insensitive)&lt;/span&gt;
&lt;span class="na"&gt;ignored_headers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;postman-token&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;if-none-match&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🔐 Cloud Storage Authentication
&lt;/h2&gt;

&lt;p&gt;Depending on the storage backend, you'll need to configure credentials via environment variables:&lt;/p&gt;

&lt;h3&gt;
  
  
  Google Cloud Storage (GCS)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Must be authenticated using Application Default Credentials (ADC), which you can set via:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;GOOGLE_APPLICATION_CREDENTIALS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/path/to/service-account.json"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Amazon S3
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Required environment variables:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;AWS_ACCESS_KEY_ID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your-access-key-id
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;AWS_SECRET_ACCESS_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your-secret-key
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;AWS_REGION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;us-east-1  &lt;span class="c"&gt;# or your specific region&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Azure Blob Storage
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Required environment variables:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;AZURE_STORAGE_ACCOUNT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your_account_name
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;AZURE_STORAGE_ACCESS_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your_access_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Local Filesystem
&lt;/h3&gt;

&lt;h2&gt;
  
  
  - No additional credentials required. Cache files will be saved locally.
&lt;/h2&gt;

&lt;h2&gt;
  
  
  📦 Building
&lt;/h2&gt;

&lt;p&gt;To build locally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo build &lt;span class="nt"&gt;--release&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To cross-compile:&lt;br&gt;
See &lt;code&gt;.github/workflows/release.yml&lt;/code&gt; for cross-target examples.&lt;/p&gt;


&lt;h2&gt;
  
  
  📊 Prometheus Metrics
&lt;/h2&gt;

&lt;p&gt;CacheBolt exposes Prometheus-compatible metrics at the &lt;code&gt;/metrics&lt;/code&gt; endpoint on port &lt;code&gt;3000&lt;/code&gt;. These metrics allow you to monitor request flow, latency thresholds, memory caching, and backend persistence.&lt;/p&gt;
&lt;h3&gt;
  
  
  Request Metrics
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cachebolt_proxy_requests_total{uri}&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Total number of proxy requests received, labeled by URI.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cachebolt_downstream_failures_total{uri}&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Count of downstream request failures per URI.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cachebolt_rejected_due_to_concurrency_total{uri}&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Requests rejected due to max concurrency being exceeded.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cachebolt_failover_total{uri}&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Requests served via failover mode due to recent high latency.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  In-Memory Cache Metrics
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cachebolt_memory_hits_total{uri}&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Requests served directly from the in-memory cache.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cachebolt_memory_store_total{uri}&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Responses stored into the in-memory cache.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cachebolt_memory_fallback_hits_total&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Failover-mode requests served from memory cache.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Latency Monitoring
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cachebolt_proxy_request_latency_ms{uri}&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Histogram of proxy request latency in milliseconds.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cachebolt_latency_exceeded_ms{uri}&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Histogram of requests whose latency exceeded the configured threshold.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cachebolt_latency_exceeded_total{uri}&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Count of latency threshold violations per URI.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Persistent Storage Metrics
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cachebolt_persist_attempts_total{backend}&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Number of attempts to persist cache entries into the selected backend.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cachebolt_persist_errors_total{backend}&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Number of failed attempts to persist cache entries.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cachebolt_persistent_fallback_hits_total&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Requests served from persistent storage (GCS, S3, Azure, or local) during failover.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;cachebolt_fallback_miss_total&lt;/code&gt;&lt;br&gt;&lt;br&gt;
Count of failover attempts that missed both memory and persistent storage.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  🧹 Cache Invalidation
&lt;/h2&gt;

&lt;p&gt;You can clear the entire cache (both in-memory and persistent storage) using the &lt;code&gt;/cache?backend=true&lt;/code&gt; endpoint. This is useful when deploying major updates or invalidating stale content globally.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When &lt;code&gt;backend=true&lt;/code&gt;, CacheBolt will delete all cache entries stored in:

&lt;ul&gt;
&lt;li&gt;🟢 Amazon S3&lt;/li&gt;
&lt;li&gt;🔵 Google Cloud Storage&lt;/li&gt;
&lt;li&gt;🔶 Azure Blob Storage&lt;/li&gt;
&lt;li&gt;💽 Local Filesystem&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  ✅ Example: Full cache invalidation
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; DELETE &lt;span class="s2"&gt;"http://localhost:3001/admin/cache?backend=true"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  📊 Memory Cache Status Endpoint
&lt;/h2&gt;

&lt;p&gt;CacheBolt includes an endpoint to inspect the current in-memory cache state in real time.&lt;/p&gt;
&lt;h3&gt;
  
  
  🔍 Endpoint
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;--location&lt;/span&gt; &lt;span class="s1"&gt;'http://localhost:3001/admin/status-memory'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Returns a JSON object where each key is a hashed cache key, and the value includes metadata:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"e43bd17d..."&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"path"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/api/v1/products/123"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"inserted_at"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2025-06-15T21:54:31Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"size_bytes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;879&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ttl_remaining_secs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;173&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"a128be77..."&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"path"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/auth/session"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"inserted_at"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2025-06-15T21:50:12Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"size_bytes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1601&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ttl_remaining_secs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  📄 License
&lt;/h2&gt;

&lt;p&gt;Licensed under the &lt;a href="//./LICENSE"&gt;Apache License 2.0&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
