移动前端缓存问题


在移动web页面,
将js文件缓存在localstorage中,有没有什么成熟的方案?能很好的解决相关的版本更新问题


我看到百度首页中的js都是缓存到localstorage中的。这种方案很赞。


找到相关解决方案
seajs-localstorage


问题继续

https://github.com/QzoneTouch/commonWidget/tree/master/seajs-plugin

这个seajs本地缓存的插件,你们用的时候都成功了吗?

我是这样调用的,

页面中的配置
图片描述

manifest代码
图片描述
seajs.use 调用
图片描述
但是结果
图片描述
结果是代码对象没有返回,gf为undefine.

我把此代码读了一遍,也调试了下,没有发现什么问题。现在调用的seajs.2.1.

大家有时间 ,麻烦你帮忙看一下,谢谢

localstorage html5 seajs JavaScript

xiaiai 9 years, 8 months ago

你的CMD模块(构建之后?)的文件是什么样子的呀


 define(function (require,exports,module) {
    //xxx
})

还是
define('xxx',[''],function () {
    //xxx  
})

xxx 要跟manifest里面的key值保持一致。
比如:
define('common/config',[],function () {

})

如果不是第二种,改成第二种试试?

JohnLi2 answered 9 years, 8 months ago

Html5的offline特性可以看看,我正准备用用看: Offline web applications

小姐姐的团子 answered 9 years, 8 months ago

Your Answer