<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>参考 on bouine</title><link>https://bouine.org/v0.4/zh/docs/reference/</link><description>Recent content in 参考 on bouine</description><generator>Hugo</generator><language>zh</language><atom:link href="https://bouine.org/v0.4/zh/docs/reference/index.xml" rel="self" type="application/rss+xml"/><item><title>CLI</title><link>https://bouine.org/v0.4/zh/docs/reference/cli/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bouine.org/v0.4/zh/docs/reference/cli/</guid><description>&lt;h2 id="commands"&gt;Commands&lt;/h2&gt;



&lt;div class="expressive-code"&gt;
 &lt;figure class="frame is-terminal not-content"&gt;
 &lt;figcaption class="header"&gt;
 &lt;span class="title"&gt;&lt;/span&gt;
 &lt;/figcaption&gt;
 &lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;bouine serve --config /etc/bouine/config.yaml
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;bouine config validate &amp;lt;file&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;bouine config schema
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;bouine completion bash|zsh|fish
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;bouine purge &amp;lt;url&amp;gt; --token &amp;lt;token&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;bouine ban &lt;span style="color:#8be9fd;font-style:italic"&gt;host_regex&lt;/span&gt;&lt;span style="color:#ff79c6"&gt;=&lt;/span&gt;example.com &lt;span style="color:#8be9fd;font-style:italic"&gt;path_regex&lt;/span&gt;&lt;span style="color:#ff79c6"&gt;=&lt;/span&gt;^/api --token &amp;lt;token&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;bouine refresh &amp;lt;url&amp;gt; --token &amp;lt;token&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;bouine cluster peers
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;bouine version&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
 &lt;/figure&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;--server&lt;/code&gt; defaults to &lt;code&gt;127.0.0.1:9000&lt;/code&gt;. All commands default to port 9000 so &lt;code&gt;--server&lt;/code&gt; is optional when running locally.&lt;/p&gt;</description></item><item><title>管理 API</title><link>https://bouine.org/v0.4/zh/docs/reference/api/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bouine.org/v0.4/zh/docs/reference/api/</guid><description>&lt;h2 id="authentication"&gt;Authentication&lt;/h2&gt;
&lt;p&gt;All write endpoints require a bearer token. See 

&lt;a class="link link--text" href="https://bouine.org/v0.4/zh/docs/operations/authentication/"&gt;Authentication&lt;/a&gt; for full details on token resolution, environment variables, and config file setup.&lt;/p&gt;
&lt;p&gt;Pass the token in requests:&lt;/p&gt;



&lt;div class="expressive-code"&gt;
 &lt;figure class="frame is-terminal not-content"&gt;
 &lt;figcaption class="header"&gt;
 &lt;span class="title"&gt;&lt;/span&gt;
 &lt;/figcaption&gt;
 &lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;curl -X POST http://127.0.0.1:9000/v1/purge &lt;span style="color:#f1fa8c"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -H &lt;span style="color:#f1fa8c"&gt;&amp;#34;Authorization: Bearer your-secret-token&amp;#34;&lt;/span&gt; &lt;span style="color:#f1fa8c"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -H &lt;span style="color:#f1fa8c"&gt;&amp;#34;Content-Type: application/json&amp;#34;&lt;/span&gt; &lt;span style="color:#f1fa8c"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; -d &lt;span style="color:#f1fa8c"&gt;&amp;#39;{&amp;#34;url&amp;#34;:&amp;#34;https://example.com/page&amp;#34;}&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
 &lt;/figure&gt;
&lt;/div&gt;
&lt;h2 id="exempt-endpoints-no-token-required"&gt;Exempt endpoints (no token required)&lt;/h2&gt;
&lt;p&gt;These are always accessible without authentication — required for K8s probes and Prometheus scraping:&lt;/p&gt;</description></item><item><title>响应头</title><link>https://bouine.org/v0.4/zh/docs/reference/headers/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bouine.org/v0.4/zh/docs/reference/headers/</guid><description>&lt;h2 id="x-cache"&gt;X-Cache&lt;/h2&gt;
&lt;p&gt;指示响应的返回方式。&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;值&lt;/th&gt;
 &lt;th&gt;描述&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;HIT&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;从缓存返回（新鲜）&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;MISS&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;从源站获取并已缓存&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;STALE&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;从缓存返回（过期，在 stale-while-revalidate 或 stale-if-error 窗口内）&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;BYPASS&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;绕过缓存（no-store、no-cache 或路由禁用缓存）&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;REVALIDATED&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;向源站的条件请求返回 304，从缓存返回并更新新鲜度&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;



&lt;div class="expressive-code"&gt;
 &lt;figure class="frame is-terminal not-content"&gt;
 &lt;figcaption class="header"&gt;
 &lt;span class="title"&gt;&lt;/span&gt;
 &lt;/figcaption&gt;
 &lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;curl -sI http://localhost:8080/get | grep x-cache
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6272a4"&gt;# X-Cache: HIT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
 &lt;/figure&gt;
&lt;/div&gt;
&lt;h2 id="age"&gt;Age&lt;/h2&gt;
&lt;p&gt;缓存对象的年龄（秒），计算自原始响应的 &lt;code&gt;Date&lt;/code&gt; 头加上在
上游转发代理中花费的时间。每次缓存命中时更新。&lt;/p&gt;</description></item><item><title>Go SDK</title><link>https://bouine.org/v0.4/zh/docs/reference/go-sdk/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://bouine.org/v0.4/zh/docs/reference/go-sdk/</guid><description>&lt;p&gt;The bouine Go SDK (&lt;code&gt;pkg/bouineapi&lt;/code&gt;) provides typed methods for every
admin API endpoint. It shares wire types with the Cobra CLI and the
admin server, so there is no drift between the SDK and the API.&lt;/p&gt;</description></item></channel></rss>