Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Move resource thumbnails out of SQL Server and stop base64-inlining them

未关闭
#45 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
32/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
技术栈
azure, csharp, sql

调研方向

先阅读 LearningResource.cs:42 和 OpenGraphService.cs:252-258,然后跟踪 SharedView.razor:164、Resources.razor:268-270、Shared/ResourceCard.razor:130 以及 FriendResources.razor:174 中的缩略图渲染。完成的标准是列表查询不读取图像字节,渲染后的标记不包含 base64 数据,缩略图通过提议的 endpoint 提供,并且现有缩略图已完成迁移。

由索引模型根据 Issue 内容生成。

描述

enhancement

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:42
  • LearnStack.Core/Services/OpenGraphService.cs:252-258 — accepts images up to 5 MB
  • LearnStack/Components/Pages/SharedView.razor:164, Resources.razor:268-270, Shared/ResourceCard.razor:130, Pages/FriendResources.razor:174
Proposed fix
  1. Store blobs in Azure Blob Storage (or at minimum a separate table) keyed by resource id.
  2. Serve them from a cached GET /thumbnails/{id} endpoint with proper Cache-Control and ETag.
  3. Downscale and re-encode on ingest (~400 px wide WebP, tens of KB).
  4. 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 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

kasuken/LearnStack 的其他 Issue

查看 kasuken/LearnStack 的全部 Issue

相似的 Issue

更多 Backend & API Design Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。