HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
⚽
SFAM (스포츠 패밀리) Portfolio
/
확장자 검증 성능 개선

확장자 검증 성능 개선

Tags
개선
문제점해결 [3.7s → 1.2s]
파일 확장자 검증 및 성능 개선
자세히 보기

문제점

  • 저희 서비스에는 이미지 파일에 대한 확장자 검사만 필요했기 때문에 65536 바이트까지 읽고 검증하는 것이 비효율적이라고 판단했습니다.
  • 아파치 티카 검증 매커니즘 살펴보기
 

해결 [3.7s → 1.2s]

  • 해당 아파치 티카와 유사하게 시그니처를 검증할 수 있도록 커스텀하여 24바이트만 읽어도록 구성하여 메모리적 측면과 속도적 측면을 개선시켰습니다. (100개의 쓰레드에서 2.8s → 0.7 개선)
  • 직접 이미지 형식의 확장들의 Header Signiture들에 대한 MimeType을 만들고 검증할 수 있도록 커스텀하였습니다.
    • notion image
 
  • Header Signature 자료
List of file signatures - Wikipedia
needs additional citations for verification .improve this article by (Learn how and when to remove this template message ) adding citations to reliable sources. Unsourced material may be challenged and removed.
List of file signatures - Wikipedia
https://en.wikipedia.org/wiki/List_of_file_signatures
List of file signatures - Wikipedia