<?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: JohnMark Banisilon</title>
    <description>The latest articles on DEV Community by JohnMark Banisilon (@johnmark_banisilon_10cf02).</description>
    <link>https://dev.to/johnmark_banisilon_10cf02</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3704141%2F2e910726-d432-47d3-84b9-d01d79dcd419.png</url>
      <title>DEV Community: JohnMark Banisilon</title>
      <link>https://dev.to/johnmark_banisilon_10cf02</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/johnmark_banisilon_10cf02"/>
    <language>en</language>
    <item>
      <title>I built a client-side cache in Rust and compiled it to WebAssembly</title>
      <dc:creator>JohnMark Banisilon</dc:creator>
      <pubDate>Sun, 01 Nov 2026 08:13:05 +0000</pubDate>
      <link>https://dev.to/johnmark_banisilon_10cf02/i-built-a-client-side-cache-in-rust-and-compiled-it-to-webassembly-3b0i</link>
      <guid>https://dev.to/johnmark_banisilon_10cf02/i-built-a-client-side-cache-in-rust-and-compiled-it-to-webassembly-3b0i</guid>
      <description>&lt;p&gt;I built &lt;strong&gt;Blaze Cache&lt;/strong&gt;, a high-performance client-side caching library written in Rust and compiled to WebAssembly.&lt;/p&gt;

&lt;p&gt;The goal was simple: make browser caching fast, predictable, and easy to integrate — without turning it into a heavy framework.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Wasm?
&lt;/h2&gt;

&lt;p&gt;Most browser caches are pure JavaScript. That works, but I wanted:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;More predictable performance&lt;/li&gt;
&lt;li&gt;A cleaner core data structure&lt;/li&gt;
&lt;li&gt;A single engine that multiple adapters could share&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the hot path (storage, TTL, tags, eviction) runs in Rust → Wasm. After initialization, &lt;code&gt;get&lt;/code&gt; and &lt;code&gt;set&lt;/code&gt; are fully synchronous.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it supports
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Synchronous reads and writes after init&lt;/li&gt;
&lt;li&gt;SIEVE eviction&lt;/li&gt;
&lt;li&gt;TTL + tag-based invalidation&lt;/li&gt;
&lt;li&gt;Optional IndexedDB persistence&lt;/li&gt;
&lt;li&gt;Typed event system&lt;/li&gt;
&lt;li&gt;Adapters for:

&lt;ul&gt;
&lt;li&gt;Axios&lt;/li&gt;
&lt;li&gt;fetch&lt;/li&gt;
&lt;li&gt;TanStack Query&lt;/li&gt;
&lt;li&gt;SWR&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
ts
import { createCache } from '@blaze-cache/core'

const cache = await createCache({ capacity: 1000 })

cache.set('user:42', { name: 'Ada' }, { ttlMs: 30_000, tags: ['user'] })
cache.get('user:42')
cache.invalidateTags('user')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>webassembly</category>
      <category>rust</category>
      <category>javascript</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
