一键导入
icon-caching
General techniques for optimizing user icon/avatar image serving in ISUCON web applications
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
General techniques for optimizing user icon/avatar image serving in ISUCON web applications
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
MCP tool reference — exec, benchmark_start, benchmark_status, note_write, etc. Use when: executing commands on VMs, running benchmarks, or recording findings
ISUCON13 contest manual — server topology, service management, benchmark execution, and rules. Use when: checking environment setup, running benchmarks, or understanding contest constraints
ISUPipe application manual — features, terms, constraints, and API specs. Use when: understanding the app domain, checking API behavior or MUST/MAY requirements
General strategy for identifying and adding missing database indexes in ISUCON web applications
General techniques for identifying and fixing N+1 query problems in ISUCON web applications
Install and use alp (Access Log Profiler) to identify slow nginx endpoints and analyze request patterns
| name | icon-caching |
| description | General techniques for optimizing user icon/avatar image serving in ISUCON web applications |
ISUCON の Web アプリでは、ユーザーアイコンやプロフィール画像を DB (BLOB) に格納していることが多い。リクエストごとに大きな BLOB を読み出すのはボトルネックになりやすい。
If-None-Match ヘッダーとハッシュを比較304 Not Modified(ボディなし)200 OK + ETag ヘッダー付きで画像返却// 例: Go (echo)
hash := fmt.Sprintf("%x", sha256.Sum256(imageData))
if c.Request().Header.Get("If-None-Match") == fmt.Sprintf(`"%s"`, hash) {
return c.NoContent(http.StatusNotModified)
}
c.Response().Header().Set("ETag", fmt.Sprintf(`"%s"`, hash))
return c.Blob(http.StatusOK, "image/jpeg", imageData)
sendfile + etag on で直接配信POST /api/initialize でデータリセットされる場合、キャッシュも適切にクリアする