etag

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package etag 提供 HTTP ETag / 条件请求中间件:为 GET 响应计算强 ETag,并在客户端带 If-None-Match 命中时回 304 Not Modified,省去重复传输的带宽。

实现:缓冲下游响应体,对 200 的 GET 响应用其内容算 ETag(FNV-1a 十六进制,强校验器)。 因需缓冲整个响应体,适合 JSON API 等中小响应的按需接入;流式/大响应不建议套用。 若下游已自行设置 ETag,则尊重下游、不覆盖。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(next http.Handler) http.Handler

Middleware 返回 ETag 中间件。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL