0
我有我的設置/代碼如下所示(順便說一句,我下面的nettuts quick tip)爲什麼我的HTML5應用程序緩存不工作?
// index.html
<!DOCTYPE HTML>
<html lang="en-US" manifest="cache.manifest">
// cache.manifest
CACHE MANIFEST
# version 2
index.html
style.css
scripts.css
// httpd.conf (i tried having a local .htaccess too)
AddType text/cache-manifest .manifest
AddType text/cache-manifest manifest // i have this as its whats shown in the video. anyway even if i remove this it still fails.
更新:
日誌從現場HTTP頭@pastebin
http://localhost/cache.manifest
GET /cache.manifest HTTP/1.1
Host: localhost
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 (.NET CLR 3.5.30729; .NET4.0E) FirePHP/0.4
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://localhost/
X-Moz: offline-resource
Pragma: no-cache
Cache-Control: no-cache
HTTP/1.1 200 OK
Date: Sat, 04 Sep 2010 03:14:16 GMT
Server: Apache/2.2.16 (Win32) PHP/5.3.3
Last-Modified: Sat, 04 Sep 2010 03:14:09 GMT
Etag: "700000000238e-42-48f6670db41b9"
Accept-Ranges: bytes
Content-Length: 66
Keep-Alive: timeout=5, max=94
Connection: Keep-Alive
Content-Type: text/cache-manifest
做我看最後一行? Content-Type: text/cache-manifest
或第6 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
。
我認爲它的工作現在,但如果我從谷歌CDN jQuery,它不會在第二次刷新工作,我認爲它只嘗試使用本地文件?
您是否使用LiveHTTPHeaders(或類似的)檢查過您的AddType規則正在工作? – robertc 2010-09-03 12:34:30
我如何使用Live HTTP頭?我在響應代碼中看到HTTP 200。在螢火蟲網絡面板中,我看到GET localhost,style.css&jquery.min.js。但沒有緩存.manifest – 2010-09-03 14:07:55
在Firefox中從此處安裝它:http://livehttpheaders.mozdev.org/然後使用它(工具 - > LiveHTTPHeaders)來檢查服務器發送它時清單的內容類型。 – robertc 2010-09-03 17:22:09