Move resource thumbnails out of SQL Server and stop base64-inlining them
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 32/100
调研方向
先阅读 LearningResource.cs:42 和 OpenGraphService.cs:252-258,然后跟踪 SharedView.razor:164、Resources.razor:268-270、Shared/ResourceCard.razor:130 以及 FriendResources.razor:174 中的缩略图渲染。完成的标准是列表查询不读取图像字节,渲染后的标记不包含 base64 数据,缩略图通过提议的 endpoint 提供,并且现有缩略图已完成迁移。
由索引模型根据 Issue 内容生成。
描述
Tier 2 — scale
Problem
LearningResource.ThumbnailImage is a varbinary(max) column holding images of up to 5 MB, sitting on the same row as the resource. Every list query loads it, and every render base64-inlines it into the HTML — so a 20-card page can push tens of MB through the SignalR circuit. This already forced the removal of persistent component state (commit a003ea8, "prevent oversized Blazor circuit state"); the underlying cause was never addressed, so the cost just moved to re-rendering.
Evidence
LearnStack.Core/Data/Models/LearningResource.cs:42LearnStack.Core/Services/OpenGraphService.cs:252-258— accepts images up to 5 MBLearnStack/Components/Pages/SharedView.razor:164,Resources.razor:268-270,Shared/ResourceCard.razor:130,Pages/FriendResources.razor:174
Proposed fix
- Store blobs in Azure Blob Storage (or at minimum a separate table) keyed by resource id.
- Serve them from a cached
GET /thumbnails/{id}endpoint with properCache-Controland ETag. - Downscale and re-encode on ingest (~400 px wide WebP, tens of KB).
- Never select the blob column in list projections.
Acceptance criteria
- No base64 image data in rendered markup
- List queries do not transfer image bytes
- Existing thumbnails migrated
- 主要语言
- HTML
- 星标
- 10
- 派生
- 0
- 平均合并
- 2 小时 35 分钟
- 30 天内合并 PR
- 21
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
kasuken/LearnStack 的其他 Issue
-
enhancement
难度 1/5 1 小时以内 新手友好度 91/100
kasuken/LearnStack#59 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
kasuken/LearnStack#72 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 30/100
kasuken/LearnStack#71 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
kasuken/LearnStack#70 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 45/100
kasuken/LearnStack#69 ·
维护者通常 1 天内回复
查看 kasuken/LearnStack 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
rpm-software-management/mock#1824 ·
-
bug good first issue hacktoberfest
难度 1/5 1 小时以内 新手友好度 78/100
gridhead/gi-loadouts#699 ·
维护者通常 13 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
MoonshotAI/kimi-code#4146 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
farbenmeer/tapi#531 ·
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复