From 4704bf920fb5a9e983bfb5b80c5dcac6ca347dc2 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 13:12:21 +0100 Subject: unslug zh-tw: modify --- .../index.html" | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'files/zh-tw/orphaned/firefox_中的離線資源') diff --git "a/files/zh-tw/orphaned/firefox_\344\270\255\347\232\204\351\233\242\347\267\232\350\263\207\346\272\220/index.html" "b/files/zh-tw/orphaned/firefox_\344\270\255\347\232\204\351\233\242\347\267\232\350\263\207\346\272\220/index.html" index 0b1180d3ca..800bac1876 100644 --- "a/files/zh-tw/orphaned/firefox_\344\270\255\347\232\204\351\233\242\347\267\232\350\263\207\346\272\220/index.html" +++ "b/files/zh-tw/orphaned/firefox_\344\270\255\347\232\204\351\233\242\347\267\232\350\263\207\346\272\220/index.html" @@ -1,9 +1,10 @@ --- title: Firefox 中的離線資源 -slug: Firefox_中的離線資源 +slug: orphaned/Firefox_中的離線資源 tags: - HTML5 離線 - application cache +original_slug: Firefox_中的離線資源 ---

 

原文 : Using Application Cache

 

介紹

  HTML5 提供了 cache 機制,使得網路應用程式能較不受到網路狀態的影響。開發人員可以藉由 Application Cache (AppCache) 的介面來定義哪些資源應當被瀏覽器儲存起來 - 如此一來即使網路斷線使用者依舊可以取得這些資源。同時,應用程式也能正確的運行即使使用者按下了「重新載入」的按鈕。

  大抵來說,使用 Application Cache 可以取得下列好處:

  • 離線瀏覽:使用者可以在斷線/離線時瀏覽你的網站
  • 網站加速:善用 AppCache 就可以減少載入重複資源的狀況,進而加速網站讀取速度
  • 減少伺服器的負擔:瀏覽器僅只有在伺服器上資源發生變動時才重新抓取資料

application cache 運作的機制

啟動 application cache

  啟動 AppCache 的方法很簡單,你只需要在你程式頁面中,html 元素裡指名 manifest 的位置即可,這裡有個簡單範例:

<html manifest="example.appcache"> 
-- 
cgit v1.2.3-54-g00ecf