gpt4 book ai didi

javascript - 文件不被缓存

转载 作者:行者123 更新时间:2023-12-02 18:41:17 33 4
gpt4 key购买 nike

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

但唯一不缓存的是我的画廊 slider 的库。我不知道为什么。

有人可以帮我吗?我在三天内尝试了很多事情,但我不明白为什么会发生这种情况。换了很多目录,看看是不是路径问题。但没有任何效果。

注意:我使用了两次库,因为我在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

最佳答案

您可以使用缓存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"

关于javascript - 文件不被缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16814309/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com