<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Static-Assets on BenzHub</title><link>https://benzhub.github.io/tags/static-assets/</link><description>Recent content in Static-Assets on BenzHub</description><generator>Hugo</generator><language>zh-TW</language><lastBuildDate>Sun, 13 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://benzhub.github.io/tags/static-assets/index.xml" rel="self" type="application/rss+xml"/><item><title>Workers Static Assets 靜態託管實作 | Cloudflare 完整教學</title><link>https://benzhub.github.io/post/cloudflare/044-workers-static-assets/</link><pubDate>Sun, 13 Sep 2026 00:00:00 +0000</pubDate><guid>https://benzhub.github.io/post/cloudflare/044-workers-static-assets/</guid><description>&lt;blockquote&gt;
&lt;p&gt;這一篇要帶你&lt;strong&gt;動手實作&lt;/strong&gt; &lt;strong&gt;Workers Static Assets&lt;/strong&gt; 的靜態託管。上一篇我們攤開了「Pages 還是 Workers」的選型地圖,這一篇就把 &lt;strong&gt;Workers Static Assets&lt;/strong&gt; 拆開來,一行一行講清楚 &lt;code&gt;wrangler.jsonc&lt;/code&gt; 裡 &lt;code&gt;assets&lt;/code&gt; 的每個選項:&lt;code&gt;directory&lt;/code&gt;、&lt;code&gt;binding&lt;/code&gt;、&lt;code&gt;html_handling&lt;/code&gt;、&lt;code&gt;not_found_handling&lt;/code&gt;、&lt;code&gt;run_worker_first&lt;/code&gt;,並實作純靜態站、&lt;strong&gt;SPA&lt;/strong&gt; fallback、靜態與 Worker API 共存,以及 &lt;code&gt;env.ASSETS.fetch&lt;/code&gt; 的用法,順帶說清楚為什麼靜態請求免費、快取怎麼運作。&lt;/p&gt;
&lt;/blockquote&gt;</description></item></channel></rss>