0

我使用 cache.manifest 文件离线查看我的项目,一切正常。

但唯一没有缓存的是我的画廊滑块的库。我不知道为什么。

有人能帮帮我吗?我在三天内尝试了很多东西,但我不明白为什么会这样。更改了很多目录以查看问题是否出在路径上。但没有任何工作。

注意:我使用了两次库,因为我在 index.html 和 Destaque.html 中使用了图库

我要缓存的库是这样的:

elastislide.css
modernizr.custom.17475.js
jquery.elastislide.js
jquerypp.custom.js

我的 cache.manifest 文件如下所示:

CACHE MANIFEST

index.html
boilerplate.css
master.css
elastislide.css
jquery.mobile-1.3.1.min.css
jquery.bxslider.css
css/shCore.css
css/shThemeDefault.css
flexslider.css
social-likes.css
imagens/Horizontal/HomeHorizontal2.jpg
imagens/Horizontal/2.jpg
imagens/Horizontal/2.2.jpg
imagens/Horizontal/3.jpg
imagens/Horizontal/3.1.jpg
imagens/thumbsContactos/33.jpg
imagens/thumbsContactos/34.jpg
imagens/thumbsContactos/35.jpg
icon/apple-touch-icon-57x57.png
icon/apple-touch-icon-72x72.png
icon/apple-touch-icon-144x144.png
icon/close_pop.png
icon/mail-icon.png
icon/plus2.png
icon/video-icon.png
icon/facebookicon.png
images/bg_direction_nav.png
images/icons-18-black.png
images/icons-18-white.png
images/icons-36-black.png
images/icons-36-white.png
http://www.youtube.com/embed/tqNCu-wPT6k?rel=0
http://www.youtube.com/embed/YtAZU2diFVE?rel=0
jquery-1.9.0.min.js
jquery.mobile-1.3.1.min.js
modernizr.custom.17475.js
jquery.elastislide.js
jquerypp.custom.js
offlinetest.js
js/modernizr.js
social-likes.js
jquery.bxslider.js
respond.min.js
jquery.flexslider.js
modernizr.custom.17475.js
jquery.elastislide.js
jquerypp.custom.js
js/shCore.js
js/shBrushXml.js
js/shBrushJScript.js
Destaque/js/modernizr.custom.17475.js
Destaque/js/jquery.elastislide.js
Destaque/js/jquerypp.custom.js

Network:
*

Fallback:
offline.html
4

1 回答 1

2

您可以使用缓存 htaccess。

例如:.htaccess

ExpiresActive On
ExpiresByType text/html "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"

# Feed RSS - 1 hora
ExpiresByType application/rss+xml "access plus 1 hour"

# Favicon - 1 week
ExpiresByType image/vnd.microsoft.icon "access plus 1 week"

# Images, video, audio - 1 week
ExpiresByType image/gif "access plus 1 week"
ExpiresByType image/png "access plus 1 week"
ExpiresByType image/jpg "access plus 1 week"
ExpiresByType image/jpeg "access plus 1 week"

ExpiresByType video/ogg "access plus 1 week"
ExpiresByType audio/ogg "access plus 1 week"
ExpiresByType video/mp4 "access plus 1 week"
ExpiresByType video/webm "access plus 1 week"

# Webfonts - 1 year
ExpiresByType font/truetype "access plus 1 year"
ExpiresByType font/opentype "access plus 1 year"
ExpiresByType font/woff "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"

# CSS / jScript - 5 days and 2 hours
ExpiresByType text/css "access plus 5 days 2 hours"
ExpiresByType application/javascript "access plus 5 days 2 hours"
ExpiresByType text/javascript "access plus 5 days 2 hours"
于 2013-05-29T12:55:04.073 回答