Jake_Young.log
๋ก๊ทธ์ธ
Jake_Young.log
๋ก๊ทธ์ธ
[๐Apollo] Cache - Garbage collection
Jake_Young
ยท
2021๋ 9์ 17์ผ
ํ๋ก์ฐ
0
Cache
apollo
cache eviction
garbage collection
0
์ํด๋ก ๊ณต์ ๋ฌธ์ ๋ฒ์ญ, Apollo Docs
๋ชฉ๋ก ๋ณด๊ธฐ
5/7
๊ณต์ ๋ฌธ์๋ฅผ ๋ฒ์ญํ์์ต๋๋ค.
cache.gc()
๋ ์ด์ ๋๋ฌํ ์ ์๋(js gc์ ๊ฐ์ ์๋ฆฌ) nomalized cache๋ฅผ ์ง์ด๋ค.
์ญ์ ๋ object์ list๋ฅผ ๋ฐํํ๋ค.
InMemoryCache์์ ๋ฐ๋ก ๋ถ๋ฅผ ์ ์๋ค. (ApolloClient๊ฐ ์๋๋ผ)
cache.retain()
์ ์ฐ๋ฉด gc๋ก๋ถํฐ ๋ณดํธํ ์ ์๋ค. (ํด์ ๋
cache.release()
)
cache.evict()
์ด๊ฑธ๋ก๋ object ๋ด์ single field๋ฅผ ์ญ์ ํ ์ ์๋ค.
Dangling references
evicted ๋ object์ reference๋ฅผ apollo๋ ๊ทธ๋๋ก ๊ฐ๊ณ ์๋๋ค.
์๋ํ๋ฉด ๋์ค์ ์ธ ์๋ ์์ผ๋๊น.
์ด๋ฅผ dangling reference๋ผ๊ณ ๋ถ๋ฅธ๋ค.
์์ธํ ๊ฑด ๋ณ๋ก ํ์ ์์ ๊ฒ ๊ฐ์์ ์๋ต..
Jake_Young
์๋ฐ์คํฌ๋ฆฝํธ์ ํ์ด์ฌ ๊ทธ๋ฆฌ๊ณ ์ปดํจํฐ์ ๋คํธ์ํฌ
ํ๋ก์ฐ
์ด์ ํฌ์คํธ
[๐Apollo] Cache - Reading and writing
๋ค์ ํฌ์คํธ
[๐Apollo] Cache - Customizing the behavior of cached fields
0๊ฐ์ ๋๊ธ
๋๊ธ ์์ฑ
๊ด๋ จ ์ฑ์ฉ ์ ๋ณด