๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๋นˆ ๊ตฌ๋ฉ ์ฑ„์šฐ๊ธฐ

[Android][WebView] cannot find symbol method setAppCacheEnabled(boolean)

์‹œ์ž‘. ์ด์Šˆ ํ™•์ธ

target version์ด 31์ธ ํ”„๋กœ์ ํŠธ์˜ target version์„ 33์œผ๋กœ ์ˆ˜์ •ํ–ˆ๋‹ค. ๊ทธ ํ›„ cannot find symbol method setAppCacheEnabled(boolean) ๋ผ๋Š” ๋นŒ๋“œ ์—๋Ÿฌ๋ฅผ ํ™•์ธํ–ˆ๋‹ค.

 

์‚ดํŽด๋ณด๋‹ˆ ๊ธฐ์กด์— ์ž˜ ์“ฐ๋˜ ์ฝ”๋“œ๋ฅผ IDE์—์„œ ํ‰์†Œ์™€๋Š” ๋‹ค๋ฅด๊ฒŒ ๋ณด์—ฌ์ฃผ๊ณ  ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ํ™•์ธํ–ˆ๋‹ค.

 

๊ธฐ์กด ๋ชจ์Šต. target version์ด 31์ด์—ˆ์„ ๋•Œ.
๋ณ€๊ฒฝ๋œ ๋ชจ์Šต. target version์„ 33์œผ๋กœ ์ˆ˜์ •ํ–ˆ์„ ๋•Œ

 

๋‚ด๋ถ€ ์ฝ”๋“œ ํ™•์ธ

WetSettings์˜ ๋‚ด๋ถ€ ์ฝ”๋“œ๋ฅผ ํ™•์ธํ•œ๋‹ค. 

target version์ด 31์ผ ๋•Œ์—๋Š” Control ํ‚ค + ๋งˆ์šฐ์Šค ํด๋ฆญ์œผ๋กœ ๋‚ด๋ถ€ ์ฝ”๋“œ๋กœ์˜ ์ด๋™์ด ๊ฐ€๋Šฅํ–ˆ๋Š”๋ฐ, target version์ด 33์ผ ๋•Œ์—๋Š” ์ด ๋ฐฉ๋ฒ•์œผ๋กœ ๋‚ด๋ถ€ ์ฝ”๋“œ๋กœ์˜ ์ด๋™์ด ๋ถˆ๊ฐ€ํ–ˆ๋‹ค. WebSettings ํด๋ž˜์Šค ์ฝ”๋“œ๋ฅผ ์ฐพ์•„๋‚˜์…”์„œ target version์ด 33์ผ ๋•Œ์˜ ํ•ด๋‹น ์ฝ”๋“œ์˜ ๋‚ด๋ถ€ ์ฝ”๋“œ๋ฅผ ํ™•์ธํ–ˆ๋‹ค. 

 

target version 31์ผ ๋•Œ ๋‚ด๋ถ€ ์ฝ”๋“œ deprecated๋˜์—ˆ๋‹ค๊ณ  ์ฃผ์„์— ๋‚˜์™€์žˆ๋‹ค.
target version 33์—์„œ์˜ ๋‚ด๋ถ€ ์ฝ”๋“œ. ์•„์˜ˆ removed ๋ผ๊ณ  ์ฃผ์„์— ๋‚˜์™€์žˆ๋‹ค.

 

์ƒํ™ฉ ํŒŒ์•…ํ•˜๊ธฐ

๋‹ค๋ฅธ ๋ธ”๋กœ๊ทธ ๊ธ€์„ ํ™•์ธํ–ˆ๋‹ค.

https://growup-lee.tistory.com/entry/WebView-setAppCacheEnabled-Deprecated

 

[WebView] setAppCacheEnabled Deprecated

AppCache ์ง€์› ์ข…๋ฃŒ AppCache๊ฐ€ Chrome 85๋ฒ„์ „๋ถ€ํ„ฐ ์ง€์›๋˜์ง€ ์•Š์•„ ์ƒˆ ๋ฒ„์ „์˜ Chromium ๊ธฐ๋ฐ˜์˜ ๋ธŒ๋ผ์šฐ์ €์—์„œ AppCache๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์—†๊ฒŒ๋˜์—ˆ๋‹ค. ์•ˆ๋“œ๋กœ์ด๋“œ WebView๋„ Chromium๊ธฐ๋ฐ˜์ด๊ธฐ ๋•Œ๋ฌธ์— AppCache๊ด€๋ จ API๊ฐ€ API

growup-lee.tistory.com

 

ํ•ด๋‹น ๋ธ”๋กœ๊ทธ ๊ธ€์„ ์ฝ๊ณ  target version 33์—์„œ์˜ WebSettings.setAppCacheEnabled()์˜ ์ฃผ์„ ๋‚ด์šฉ์ด ์ดํ•ด๊ฐ”๋‹ค. 

1) AppCache๊ฐ€ Chrome 85๋ฒ„์ „๋ถ€ํ„ฐ ์ง€์›๋˜์ง€ ์•Š๋Š”๋‹ค.

2) ์•ˆ๋“œ๋กœ์ด๋“œ WebView๋„ Chromium๊ธฐ๋ฐ˜์ด๊ธฐ ๋•Œ๋ฌธ์— AppCache๊ด€๋ จ API๊ฐ€ API Level 30๋ถ€ํ„ฐ Deprecated๋๋‹ค.

3) target version 33์—์„œ์˜ WebView๋Š” WebView 95 ์ด์ƒ์ด๊ธฐ ๋•Œ๋ฌธ์— ํ•ด๋‹น ๋ฉ”์†Œ๋“œ๋Š” ๋™์ž‘ํ•˜์ง€ ์•Š๋Š”๋‹คno-op.

no-op์˜ ๋œป : http://ko.dictionary.education/english/dictionary/no-op

 

๊ตฌ๊ธ€ ์ชฝ์—์„œ AppCache๋ฅผ ์ œ๊ฑฐํ•  ๊ฑฐ๋ผ๊ณ  ์จ๋†“์€ ๊ธ€๋„ ์ € ๋ธ”๋กœ๊ทธ ๊ธ€ ๋•๋ถ„์— ์•Œ์•˜๋‹ค.

https://web.dev/appcache-removal/

 

AppCache ์ œ๊ฑฐ ์ค€๋น„ํ•˜๊ธฐ

Chrome ๋ฐ ๊ธฐํƒ€ ๋ธŒ๋ผ์šฐ์ €์˜ AppCache ์ œ๊ฑฐ ๊ณ„ํš์— ๋Œ€ํ•œ ์„ธ๋ถ€์ •๋ณด์ž…๋‹ˆ๋‹ค.

web.dev

Service Worker๋กœ ๋งˆ์ด๊ทธ๋ž˜์ด์…˜ํ•˜๋ผ๊ณ  ํ•ด์„œ ์‚ดํŽด๋ดค๋Š”๋ฐ, ์•ˆ๋“œ๋กœ์ด๋“œ์—์„œ ์–ด๋–ป๊ฒŒ ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜ ํ•˜๋Š”์ง€์— ๋Œ€ํ•œ ๊ธ€์„ ๋ชป ์ฐพ์•˜๋‹ค๐Ÿ˜–๐Ÿ˜ต ๊ตฌ๊ธ€๋งํ•ด๋„ ์•ˆ๋‚˜์˜จ๋‹ค๐Ÿฅด ์ฝ”๋“œ ์ˆ˜์ •์„ ํ•ด์•ผ ํ•˜๋Š”๋ฐ, ๋ฐฉ๋ฒ•์„ ๋ชจ๋ฅด๊ฒ ๋‹ค. ๊ตฌ๊ธ€๋ง์„ ํ•˜๋ฉด์„œ ์ŠคํŠธ๋ ˆ์Šค ๋ฐ›๊ณ  ์žˆ๋‹ค๋Š” ๊ฑธ ์ธ์‹ํ•˜๊ณ  ์žˆ๋Š”๋ฐ, ๊ธธ์ด ํŠธ์ด๋Š” ์Šคํƒ์˜ค๋ฒ„ํ”Œ๋กœ์šฐ ๋‹ต๋ณ€์„ ๋ฐœ๊ฒฌํ–ˆ๋‹ค. 

 

https://stackoverflow.com/a/17429301

 

Caching in Android webview

Which one is faster way to load mobile web pages and non mobile web pages in Android webview; loading cache or not loading that at all? And what is recommend style to load that? Right now when I ...

stackoverflow.com

 

These have nothing to do with the default webview internal cache. Appcache is an entirely different feature mean to make you able to run the website w/o an internet connection. It does not work that great and probably you do not want to use it.
With setting this: viewer.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT) is enough.

 

AppCache๊ฐ€ ์›น๋ทฐ๊ฐ€ ๊ธฐ๋ณธ์œผ๋กœ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ๋‚ด๋ถ€ ์บ์‹œ์™€๋Š” ๋‹ค๋ฅธ ์กด์žฌ๋ผ๋Š” ๊ฒƒ์„ ์•Œ์•˜๋‹ค. AppCache๊ฐ€ ์—†์–ด๋„, ์›น๋ทฐ๋Š” ๊ธฐ๋ณธ ์บ์‹œ ๊ธฐ๋Šฅ์„ ๋™์ž‘ํ•œ๋‹ค๋Š” ๊ฑฐ๋‹ค. ์ด์ œ์•ผ ์ฃผ์„์˜ ๋‚ด์šฉ์ด ๋ˆˆ์— ๋“ค์–ด์˜จ๋‹ค.

 

Application Cache, ์ฆ‰ AppCache๋ฅผ ํ™œ์„ฑํ™”ํ•˜๊ธฐ ์œ„ํ•ด ์“ฐ๋Š” API์˜€๋˜ setAppCacheEnabled(). setAppCachePath๋„ ์„ค์ •ํ•ด์•ผ์ง€๋งŒ ํ™œ์„ฑํ™”๋œ๋‹ค๊ณ .

 

์•ˆ๋“œ๋กœ์ด๋“œ API ๋ ˆํผ๋Ÿฐ์Šค ๋ฌธ์„œ์—์„œ WebSettings ์ชฝ์— ๋” ์ด์ƒ setAppCacheEnable()์˜ ํ”์ ์€ ์—†์ง€๋งŒ

https://developer.android.com/reference/android/webkit/WebSettings

 

WebSettings  |  Android Developers

 

developer.android.com

 

๋‚ก์€ ์•ˆ๋“œ๋กœ์ด๋“œ API ๋ ˆํผ๋Ÿฌ์Šค ๋ฌธ์„œ๋ฅผ ์ฐพ์•˜๊ณ , ์—ฌ๊ธฐ์—๋Š” WebSettings์˜ setAppCacheEnabled(boolean)์— ๋Œ€ํ•ด ๋‚˜์˜จ๋‹ค.

http://www.dre.vanderbilt.edu/~schmidt/android/android-4.0/out/target/common/docs/doc-comment-check/reference/android/webkit/WebSettings.html

 

WebSettings | Android Developers

java.lang.Object    โ†ณ android.webkit.WebSettings Class Overview Manages settings state for a WebView. When a WebView is first created, it obtains a set of default settings. These default settings will be returned from any getter call. A WebSettings ob

www.dre.vanderbilt.edu

AppCache API ํ™œ์„ฑํ™” ์šฉ๋„์˜€๋˜ setAppCacheEnabled()

 

์ด์   WebView์—์„œ ๋” ์ด์ƒ Applicatin Caches API, ์ฆ‰ AppCache๋ฅผ ์ œ๊ณตํ•˜์ง€ ์•Š์œผ๋‹ˆ AppCache์™€ ๊ด€๋ จ๋œ ๋ฉ”์†Œ๋“œ๋“ค์ด ์•„์˜ˆ ์‚ฌ๋ผ์ง€๋Š” ๊ฒŒ ๋งž๋‹ค๋Š” ๊ฒŒ ์ดํ•ด๋œ๋‹ค.

 

AppCache๋Š” ๋ˆ„๊ตฌ๋ฅผ, ๋ฌด์—‡์„ ์œ„ํ•ด ์“ฐ์˜€๋˜ ๊ฑด๋ฐ

https://web.dev/appcache-beginner/#introduction

 

A beginner's guide to using the application cache

 

web.dev

๊ตฌ๊ธ€๋งํ•˜๋ฉด AppCache๊ฐ€ ์ œ๊ฑฐ๋œ๋‹ค๋Š” ๊ธ€๋งŒ ๋‚˜์˜ค๋˜๋ฐ, ์ด๊ฑธ ์ฐพ์•„๋ƒˆ๋‹ค. Introduction ๋ถ€๋ถ„์„ ๋ณด๋‹ˆ, ์ด ๊ธฐ๋Šฅ์€ ์˜คํ”„๋ผ์ธ ์ƒํƒœ์˜ ์‚ฌ์šฉ์ž๋ฅผ ์œ„ํ•œ ๊ธฐ๋Šฅ์œผ๋กœ ๋ณด์ธ๋‹ค. 

AppCache์˜ ์„ธ ๊ฐ€์ง€ ์žฅ์ . https://web.dev/appcache-beginner/#introduction

AppCache๊ฐ€ ์ œ๊ฑฐ๋œ๋‹ค๋Š” ๊ธ€์—์„œ๋Š” AppCache๊ฐ€ ์ œ๊ณตํ•˜๋Š” ์˜คํ”„๋ผ์ธ ๊ฒฝํ—˜์„ Service Worker๊ฐ€ ์ œ๊ณตํ•  ๊ฑฐ๋ผ๋ฉฐ Service Worker๋กœ ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜ํ•˜๋ผ๊ณ  ํ•œ๋‹ค. AppCache๋Š” ์˜คํ”„๋ผ์ธ ์ƒํƒœ์˜ ์‚ฌ์šฉ์ž๋ฅผ ์œ„ํ•œ ๊ธฐ๋Šฅ์ด ๋งž๋Š” ๊ฒƒ์œผ๋กœ ๋ณด์ธ๋‹ค.

https://web.dev/appcache-removal/

 

AppCache ์ œ๊ฑฐ ์ค€๋น„ํ•˜๊ธฐ

Chrome ๋ฐ ๊ธฐํƒ€ ๋ธŒ๋ผ์šฐ์ €์˜ AppCache ์ œ๊ฑฐ ๊ณ„ํš์— ๋Œ€ํ•œ ์„ธ๋ถ€์ •๋ณด์ž…๋‹ˆ๋‹ค.

web.dev

AppCache๊ฐ€ ์˜คํ”„๋ผ์ธ ๊ฒฝํ—˜์„ ์ œ๊ณตํ–ˆ์—ˆ๋„ค. https://web.dev/appcache-removal/

 

WebView์—์„œ ๊ธฐ๋ณธ์ ์œผ๋กœ ์ œ๊ณตํ•˜๋Š” Cache ๊ธฐ๋Šฅ์€ ๋ฌด์—‡์„ ํ•˜๋Š”๋ฐ 

WebSetting์—์„œ CacheMode ์„ค์ •์€ setCacheMode() ๋ฅผ ์ด์šฉํ•œ๋‹ค.

https://developer.android.com/reference/android/webkit/WebSettings#setCacheMode(int)
 

WebSettings  |  Android Developers

 

developer.android.com

 

The way the cache is used is based on the navigation type. For a normal page load, the cache is checked and content is re-validated as needed. When navigating back, content is not revalidated, instead the content is just retrieved from the cache.

๋ฐœ๋ฒˆ์—ญ

์บ์‹œ๊ฐ€ ์‚ฌ์šฉ๋˜๋Š” ๋ฐฉ์‹์€ ํ™”๋ฉด์„ ํƒ์ƒ‰ํ•˜๋Š” ์œ ํ˜•์„ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•œ๋‹ค. ์ผ๋ฐ˜ ํ™”๋ฉด์„ ๋กœ๋“œํ•  ๋•Œ, ์บ์‹œ๋ฅผ ํ™•์ธํ•˜๊ณ  ์ฝ˜ํ…์ธ ๋Š” ํ•„์š”์— ๋”ฐ๋ผ ์žฌ๊ฒ€์ฆ๋œ๋‹ค. ํ™”๋ฉด ๋’ค๋กœ๊ฐ€๊ธฐ๋ฅผ ํ•  ๋•Œ, ์ฝ˜ํ…์ธ ๋Š” ์žฌ๊ฒ€์ฆ๋˜์ง€ ์•Š๋Š” ๋Œ€์‹ ์— ์บ์‹œ์— ๋ฐ˜ํ™˜๋œ๋‹ค. 

์›น ํŽ˜์ด์ง€ ๋’ค๋กœ๊ฐ€๊ธฐ๋ฅผ ํ•˜๋ฉด ์บ์‹œ๊ฐ€ ์‚ฌ์šฉ๋œ๋‹ค๋Š” ๊ฒƒ์œผ๋กœ ์ดํ•ดํ–ˆ๋‹ค. 

 

WebSetting์€ Cache Mode๋ฅผ ๋„ค ๊ฐ€์ง€ ๊ฐ€์ง€๊ณ  ์žˆ๋‹ค. ์ด ๋ชจ๋“œ๋ฅผ setCacheMode์˜ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ๋„ฃ์–ด์„œ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.

  • LOAD_DEFAULT : ์บ์‹œ๋œ ๋ฆฌ์†Œ์Šค๊ฐ€ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•˜๊ณ  ๋งŒ๋ฃŒ๋˜์ง€ ์•Š์•˜์œผ๋ฉด ์‚ฌ์šฉํ•˜๊ณ , ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด ๋„คํŠธ์›Œํฌ์—์„œ ๋ฆฌ์†Œ์Šค๋ฅผ ๋กœ๋“œํ•œ๋‹ค.
  • LOAD_CACHE_ELSE_NETWORK : ์บ์‹œ๋œ ๋ฆฌ์†Œ์Šค๋ฅผ ๋งŒ๋ฃŒ๋˜์—ˆ์–ด๋„ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•˜๋ฉด ์‚ฌ์šฉํ•˜๊ณ , ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด ๋„คํŠธ์›Œํฌ์—์„œ ๋ฆฌ์†Œ์Šค๋ฅผ ๋กœ๋“œํ•œ๋‹ค. 
  • LOAD_NO_CACHE : ์บ์‹œ๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๋‹ค. ํ•ญ์ƒ ๋„คํŠธ์›Œํฌ์—์„œ ๋ฆฌ์†Œ์Šค๋ฅผ ๋กœ๋“œํ•œ๋‹ค.
  • LOAD_CACHE_ONLY : ์บ์‹œ์—์„œ ๋ฆฌ์†Œ์Šค๋ฅผ ๋กœ๋“œํ•œ๋‹ค. ๋„คํŠธ์›Œํฌ๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๋‹ค.

๊ตฌ๊ธ€ ์•ˆ๋“œ๋กœ์ด๋“œ ํŒ€์€ ์ด๋ ‡๊ฒŒ ๊ธฐ๋ณธ์œผ๋กœ ์ œ๊ณตํ•˜๋Š” ์บ์‹œ ๊ธฐ๋Šฅ์œผ๋กœ ๋ถ€์กฑํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ์—ˆ์–ด์„œ AppCache API๊นŒ์ง€ ์‚ฌ์šฉํ•˜๊ฒŒ ํ•ด์คฌ๋˜ ๊ฑด๊ฐ€๐Ÿค”

 

๊ตฌ๊ธ€๋ง์„ ํ•˜๋ฉฐ ๋Š๋‚€ ๊ฒƒ

  • WebView์— ๊ด€ํ•œ ์•ˆ๋“œ๋กœ์ด๋“œ API ๋ ˆํผ๋Ÿฐ์Šค ๋ฌธ์„œ๋Š” ์นœ์ ˆํ•˜์ง€ ์•Š๋‹ค. 
  • ๋ช‡๋ช‡ ๋‹ค๋ฅธ ๋ธ”๋กœ๊ทธ ๊ธ€๋“ค์—์„œ WebView ์˜ˆ์ œ ์ฝ”๋“œ๋ฅผ ๋ณด๋ฉด, setAppCacheEnabled(false) ์ฝ”๋“œ๋Š” ์บ์‹œ๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ฒ ๋‹ค๋Š” ๋ชฉ์ ์œผ๋กœ ์ผ์Œ์„ ์ฃผ์„์œผ๋กœ ์•Œ๋ ค์ค€๋‹ค. ๋‚˜๋„ ์ฒ˜์Œ์—๋Š” setAppCacheEnabled()๊ฐ€ ์บ์‹œ ๋ฏธ์‚ฌ์šฉ/์‚ฌ์šฉ์„ ์„ค์ •ํ•˜๋Š” ๋ชฉ์ ์œผ๋กœ ์“ฐ์ด๋Š” ์ค„ ์•Œ์•˜๋Š”๋ฐ(๋ฉ”์†Œ๋“œ ์ด๋ฆ„๋งŒ ๋ณด๋ฉด ๊ทธ๋ ‡๊ฒŒ ๊ธฐ๋Šฅ์„ ์œ ์ถ”ํ•˜๊ฒŒ ๋œ๋‹ค), ํ—ค๋ฉ”๊ณ  ํ—ค๋ฉ”๋Š” ๊ณผ์ •์„ ํ†ตํ•ด์„œ ์‹ค์ œ๋กœ๋Š” AppCache API์˜ ํ™œ์„ฑํ™” ์„ค์ • ๊ธฐ๋Šฅ์ž„์„ ์•Œ๊ฒŒ ๋๋‹ค. ์ •๋ง ์›น ์บ์‹œ ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•˜๊ณ  ์‹ถ์ง€ ์•Š๋‹ค๋ฉด, setAppCacheEnabled(false)์— setCacheMode(LOAD_NO_CACHE)๊นŒ์ง€ ์จ ์ฃผ๋Š” ๊ฒŒ ํ™•์‹คํžˆ ๋™์ž‘ํ•˜๋Š” ์˜ˆ์ œ์ธ ๊ฒƒ ๊ฐ™๋‹ค. 
  • ์œ„์—์„œ ์‚ดํŽด๋ณธ ์Šคํƒ์˜ค๋ฒ„ํ”Œ๋กœ์šฐ ๊ธ€ https://stackoverflow.com/a/17429301์—์„œ setCacheMode()๋ฅผ ์“ฐ๋Š” ๊ฒƒ๋งŒ์œผ๋กœ ์ถฉ๋ถ„ํ•˜๋‹ค๊ณ  ํ–ˆ๋‹ค. ์ด๋Š” setCacheMode์™€ setAppCacheEnabled์˜ ๊ธฐ๋Šฅ ์ฐจ์ด๋ฅผ ๋ช…ํ™•ํžˆ ์•Œ๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ํ•  ์ˆ˜ ์žˆ๋Š” ์–ธ๊ธ‰์ธ ๊ฒƒ ๊ฐ™๋‹ค.

 

์ฝ”๋“œ ์ˆ˜์ •

์ด์ „ ๋‹ด๋‹น์ž๋Š” ์–ด๋–ค ๊ธฐ๋Šฅ์„ ์›ํ•ด์„œ setAppCacheEnable(false), setAppCacheEnable(true) ์ฝ”๋“œ๋ฅผ ๋„ฃ์—ˆ์„์ง€ ์œ ์ถ”ํ•˜๊ณ  ์ฝ”๋“œ ์ˆ˜์ •์„ ํ•ด์•ผ๊ฒ ๋‹ค. ์ •๋ง AppCache API๋ฅผ ์‚ฌ์šฉํ•˜๊ณ ์ž/์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ ์ž ์ผ๋Š”์ง€, ์›น๋ทฐ ์บ์‹œ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ ์ž/์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ ์ž ์ผ๋Š”์ง€๋ฅผ ํŒŒ์•…ํ•ด์•ผ ํ•  ๋“ฏ ํ•˜๋‹ค. 

 

setAppCacheEnabled(false)

์ผ๋‹จ setAppCacheEnabled(false)์˜ ์ฝ”๋“œ๋ฅผ ์“ด ์˜๋„๋Š” ๋ฌด์—‡์ด์—ˆ์„๊นŒ. ํ•ด๋‹น ์ฝ”๋“œ๊ฐ€ ์“ฐ์ธ ์›น๋ทฐ ํ™”๋ฉด๋“ค์€ ๊ณตํ†ต ์›น๋ทฐ๋“ค์ด๋‹ค. ์˜ˆ๋ฅผ ํ•˜๋‚˜ ๋“ค์ž๋ฉด, ๊ณต์ง€ ๋ฆฌ์ŠคํŠธ์—์„œ ํ•ญ๋ชฉ์„ ์„ ํƒํ•˜๋ฉด ํ•ด๋‹น ๊ณต์ง€์— ๋งž๋Š” url์„ ๋กœ๋“œํ•ด ๋ณด์—ฌ์ฃผ๋Š” ์›น๋ทฐ์ด๋‹ค. ์ด๋Ÿฌํ•œ ํŠน์„ฑ์ด๋ผ๋ฉด ์บ์‹œ๋ฅผ ์“ฐ๊ณ  ์‹ถ์ง€ ์•Š์•˜๋˜ ๊ฒƒ ๊ฐ™๋‹ค. setCacheMode(LOAD_NO_CACHE) ์ฝ”๋“œ๋Š” ๋ณด์ด์ง€ ์•Š๋Š”๋‹ค. 

setAppCacheEnabled(false) ์ฝ”๋“œ๋ฅผ ๊ทธ๋ƒฅ ์ง€์šฐ๋Š” ๊ฒƒ์œผ๋กœ ๋๋‚˜๋„ ๋œ๋‹ค. ์™œ๋‚˜ํ•˜๋ฉด ์‹ค์ œ๋กœ ๊ธฐ๋ณธ ์บ์‹œ ๋ชจ๋“œ๋กœ ์›น๋ทฐ๋Š” ์“ฐ์ด๊ณ  ์žˆ์—ˆ์„ ํ…Œ๋‹ˆ ๋ง์ด๋‹ค. ์ € ์ฝ”๋“œ๋ฅผ ์ง€์šฐ๋“  ์ง€์šฐ์ง€ ์•Š๋“ , ์•ฑ๋ทฐ ๋‚ด๋ถ€ ์บ์‹œ ๋™์ž‘์€ ๋ณ€๊ฒฝ์‚ฌํ•ญ์ด ์—†๋‹ค. 

 

setAppCacheEnabled(false)๋ฅผ ์“ฐ์ง€ ์•Š์•„๋„, ์›๋ž˜ ๊ธฐ๋ณธ ์„ค์ •์œผ๋กœ App Cache API๋Š” ๋น„ํ™œ์„ฑํ™”๋˜์–ด ์žˆ๋‹ค๋Š” ๊ฒƒ์ด setAppCacheEnabled()์˜ ์ฃผ์„ ๋‚ด์šฉ์ด๋‹ค. ์ด์ „ ๋‹ด๋‹น์ž๊ฐ€ ์ •๋ง App Cache API๋ฅผ ๋น„ํ™œ์„ฑํ™”ํ•˜๊ณ  ์‹ถ์–ด์„œ ํ•ด๋‹น ์ฝ”๋“œ๋ฅผ ์“ด ๊ฒƒ์ด ์•„๋‹ˆ๋ผ, ์›น ์บ์‹œ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์‹ถ์ง€ ์•Š์•„์„œ ํ•ด๋‹น ๋ฉ”์†Œ๋“œ๋ฅผ ์ด๋ฆ„๋งŒ ๋ณด๊ณ  ์ผ๋‹ค๊ณ  ์œ ์ถ”ํ•˜๋Š” ๊ฒƒ์ด ๋งž๋Š” ๊ฒƒ ๊ฐ™๋‹ค. setAppCacheEnabled(false)๋Š” ์ง€์šฐ๊ณ , setCacheMode(LOAD_NO_CACHE)๋ฅผ ์ถ”๊ฐ€ํ•˜๊ธฐ๋กœ ํ–ˆ๋‹ค.

 

setAppCacheEnabled(true)

setAppCacheEnabled(true)๋ฅผ ์“ด ์ฝ”๋“œ๋ฅผ ํ™•์ธํ–ˆ๋‹ค. ๊ฒฐ์ œ ์›น๋ทฐ ํŽ˜์ด์ง€์ด๊ณ , setAppCachePath() ์ฝ”๋“œ๋„ ์ž‘์„ฑ๋˜์–ด ์žˆ์–ด์„œ, AppCache API๋ฅผ ์ œ๋Œ€๋กœ ํ™œ์„ฑํ™”์‹œ์ผฐ๋‹ค. setCacheMode() ์ฝ”๋“œ๋Š” ์—†๋‹ค. LOAD_DEFAULT ๋ชจ๋“œ๋กœ ๋™์ž‘ํ•˜๊ณ  ์žˆ์—ˆ๊ฒ ๋‹ค.

AppCache๊ฐ€ ์—†์–ด๋„ ๊ฒฐ์ œ ๊ธฐ๋Šฅ๋“ค์ด ์ œ๋Œ€๋กœ ๋Œ์•„๊ฐ€๋Š” ๊ฒŒ ๋งž๊ฒ ์ง€๋งŒ, ๋ถˆ์•ˆํ•œ ๋งˆ์Œ์— ๋‹ค๋ฅธ ์›น๋ทฐ ๊ฒฐ์ œ ์˜ˆ์ œ ์ฝ”๋“œ๋“ค์„ ์ข€ ์‚ดํŽด๋ดค๋‹ค.

https://developers.nicepay.co.kr/manual-app.php

 

Manual

์•ˆ๋“œ๋กœ์ด๋“œ Kotlin Web-view ์—ฐ๋™

developers.nicepay.co.kr

https://shopby.works/guide/skin/dev-cover/app-payment-module?lv=11 

 

์›Œํฌ์ŠคํŽ˜์ด์Šค | NHN์ปค๋จธ์Šค

๋น„์ฆˆ๋‹ˆ์Šค ์šด์˜์ด ํŽธ๋ฆฌํ•œ ๋””์ž์ธ·๊ฐœ๋ฐœ ํ™˜๊ฒฝ, ์›Œํฌ์ŠคํŽ˜์ด์Šค์—์„œ ์ปค๋จธ์Šค์˜ ๋ฌดํ•œํ•œ ๊ฐ€๋Šฅ์„ฑ์„ ๊ฒฝํ—˜ํ•ด ๋ณด์„ธ์š”.

shopby.works

 

๋‘ ์˜ˆ์ œ ๋‹ค setAppCacheEnabled() ๋Š” ์“ฐ์ง€๋„ ์•Š๊ณ , ๊ธฐ๋ณธ Cache ๋ชจ๋“œ๋ฅผ ์“ฐ๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•˜๋Š” ๋“ฏ ํ•˜๋‹ค.

 

๊ทธ๋Ÿผ, AppCache API ๊ด€๋ จ ์ฝ”๋“œ๋“ค์„ ์ง€์›Œ์ฃผ๋Š” ๊ฒƒ๋งŒ์œผ๋กœ ์ˆ˜์ •์€ ์ถฉ๋ถ„ํ•œ ๊ฒƒ ๊ฐ™๋‹ค.

 

๋ฌผ๋ก  ์ˆ˜์ •ํ•œ ์ฝ”๋“œ์— ๋Œ€ํ•ด ํ…Œ์ŠคํŠธ๋Š” ํ•„์ˆ˜์ด๊ณ .

 

๊ตฌ๊ธ€๋งํ•˜๋‹ค๊ฐ€ ์ฐพ๊ฒŒ๋œ ๊ฒƒ

์›น ์บ์‹œ

https://cyberx.tistory.com/9

 

๋” ๋น ๋ฅธ ์›น์„ ์œ„ํ•˜์—ฌ - ์›น ์บ์‰ฌ (WEB CACHE)

WEB-CACHE (TIME-SPACE TRADEOFF) ๋” ๋น ๋ฅธ ์›น์‚ฌ์ดํŠธ๋ฅผ ์œ„ํ•ด ์ €ํฌ ๊ฐœ๋ฐœ์ž๋“ค์€ ๋ˆˆ๋ฌผ๊ฒจ์šด ๋…ธ๋ ฅ์„ ๋งŽ์ด ํ•ฉ๋‹ˆ๋‹ค. - WebCache - Code Compressing - Image Optimizing - Image Spriting - Critical Rendering Path - Webfont Optimizing - Lazy Loadin

cyberx.tistory.com