清理 ios 中的 uiwebview 緩存 (clean uiwebview cache in ios)


問題描述

清理 ios 中的 uiwebview 緩存 (clean uiwebview cache in ios)

我正在使用 uiwebview 來顯示我的網頁內容。使用 RevealViewController 導航到不同的 url。我正在緩存第一次進入的所有頁面。

在嘗試轉到後視圖(顯示視圖控制器菜單屏幕)時訪問了幾個頁面後,應用程序在單擊菜單按鈕時卡住了一段時間.

(每次訪問和緩存一個頁面都會增加app的內存大小)


參考解法

方法 1:

If the presentation of the menu is slow, it is probably because you are doing some heavy processsing inside the initialiser of the menu or the viewDidLoad function, or the menu button pressed function.

My suggestion is to move any of that processing to the viewDidAppear method of your menu controller instead, so that the UI is not blocked by any processing you do. You could also use GCD to disaptch_async anything that is intensive.

If you give some code examples it will be easier to see exactly what the problem is, particularly the code that executes when the menu button is pressed.

(by Rabindra LaheriBinaryGuy)

參考文件

  1. clean uiwebview cache in ios (CC BY‑SA 2.5/3.0/4.0)

#caching #iOS #uiviewcontroller






相關問題

Heroku 上的頁面緩存技巧? (Page caching trick on Heroku?)

Array of Structs selalu lebih cepat daripada Structs of arrays? (Array of Structs are always faster than Structs of arrays?)

使用 Varnish 更改標頭中的引用者 (Change Referrer in header using Varnish)

清理 ios 中的 uiwebview 緩存 (clean uiwebview cache in ios)

緩存整個表 (Caching the entire table)

過期/緩存控制標頭的問題 (Problem with Expires/Cache-Control Headers)

強制 L1 緩存上的一些數據 (force some data on L1 cache)

Facebook API - 在服務器上緩存響應 (Facebook API - cache response on server)

ASIHTTPRequest 離線模式連接失敗 (ASIHTTPRequest offline mode connection failure)

如果小於 X 天,如何從磁盤讀取文件,如果舊,則重新獲取 html 文件 (How to read a file from the disk if less than X days old, if older, refetch the html file)

當您的應用服務器託管在不同的雲服務上時,如何安全地從 Firebase 託管上的 CDN 緩存中受益 (How to safely benefit from CDN caching on Firebase Hosting when your app's server is hosted on a different Cloud service)

如何使用java處理緩存中的鎖定(ConcurrentHashMap) (How to handle lock in cache (ConcurrentHashMap) using java)







留言討論