Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

이미지 처리 및 캐싱 모듈 수정 #98

Merged
merged 6 commits into from
Dec 12, 2022
Merged

Conversation

trumanfromkorea
Copy link
Member

제출 전 필수 확인 사항:

  • Merge 하는 브랜치가 올바른가?
  • 코드 컨벤션을 준수하는가?
  • 빌드가 되는 코드인가요?
  • 버그가 발생하지 않는지 충분히 테스트 해봤나요?

작업 내용:

  • 이미지 처리 및 캐싱 모듈 수정
  • NSCache extension 으로 subscript 구현
  • NSCache 용량 조정
  • 다운샘플링 코드 위치 이동 및 로직 수정

Copy link
Collaborator

@hongpower hongpower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니당!

// Created by 장재훈 on 2022/12/10.
//

import UIKit.UIImage
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

필요한 모듈만 import 하는거 👍

private let cache = NSCache<NSString, NSData>()
private let cache: NSCache = {
let cache = NSCache<NSString, NSData>()
cache.totalCostLimit = 52428800
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

혹시 이 totalCostLimit 은 어떻게 계산해서(?) 나온 값인가요?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

50MB 인데요
저희 Storage 에 4명이서 마구마구 올려둔 이미지 용량이 총 80MB 이더라구요
그리고 앱 메모리를 얼마나 쓰냐 생각해봤을때 캐시가 100MB 라고 하면 넘 많은것 같아서 50MB 정도가 적당하겠다 싶었읍니다

@trumanfromkorea trumanfromkorea merged commit 67b6f66 into develop Dec 12, 2022
@trumanfromkorea trumanfromkorea deleted the feature_image branch December 12, 2022 07:04
@trumanfromkorea
Copy link
Member Author

리뷰 감사합니당 ~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants