배포 환경에서 캐릭터 이미지 저장 실패 해결#66
Merged
Merged
Conversation
서비스워커가 외부 S3 이미지까지 캐싱하며 opaque 응답을 저장해 html-to-image의 CORS fetch가 tainted canvas로 실패하던 문제 수정. - runtimeCaching을 same-origin 자원만 매칭하도록 제한 - 오염된 캐시 폐기를 위해 cacheName bump (static-assets-v2) - img에 crossOrigin="anonymous" 추가로 CORS 로드 보장 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
📝 WalkthroughWalkthrough이 PR은 리소스 로딩과 캐싱 정책을 개선한다. 캐릭터 공유 페이지의 이미지 렌더링에 Changes리소스 로딩 및 캐싱 정책
Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying moddo-frontend with
|
| Latest commit: |
f88a268
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://db61c151.moddo-frontend.pages.dev |
| Branch Preview URL: | https://fix-image-test.moddo-frontend.pages.dev |
# Conflicts: # src/pages/characterShare/CharacterSharePage.tsx
develop의 fetch 기반 다운로드에서는 canvas tainting이 없어 불필요하고, S3 CORS 미허용 origin에서 이미지 표시가 깨지는 부작용이 있어 제거. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
문제
moddo.kr)에서 캐릭터 이미지 저장이 실패. localhost에서는 정상 동작.원인
서비스워커의
runtimeCaching규칙(/\.(?:js|css|png|jpg|jpeg|svg)$/)이 출처를 가리지 않아 외부 S3 이미지까지 캐싱하는 것이 근본 원인.crossOrigin없이 로드되면서 SW가 opaque 응답을 캐시에 저장.fetch(imageUrl)이 그 opaque 응답을 돌려받아response.ok === false→ 저장 실패.runtimeCaching규칙은 프로덕션 빌드 SW에서만 적용되고, dev SW에는 없어 S3 이미지를 가로채지 않기 때문.변경
cacheNamebump (static-assets→static-assets-v2) → 기존에 오염된 opaque 캐시 엔트리 폐기테스트 방법
moddo.kr에서 하드 리로드(캐시 비우기) 후 일반 Chrome에서 캐릭터 이미지 저장 성공 확인🤖 Generated with Claude Code