admin 管理员组文章数量: 1086019
i want to prevent all the app`s pages cache in Framework 7. is there any option i can add here
var myApp = new Framework7({
material: true //enable Material theme
})
or a function that can make me stop caching permanently.
i want to prevent all the app`s pages cache in Framework 7. is there any option i can add here
var myApp = new Framework7({
material: true //enable Material theme
})
or a function that can make me stop caching permanently.
Share Improve this question asked Jul 16, 2016 at 17:24 Mahmoud MabroukMahmoud Mabrouk 7333 gold badges13 silver badges31 bronze badges3 Answers
Reset to default 6You may set cache: false
as in
var myApp = new Framework7({
cache: false /* disable caching */
})
or (if it's fitter for your application) you may set its duration to zero setting cacheDuration: 0
as in
var myApp = new Framework7({
cacheDuration: 0 /* set caching expire time to 0 */
})
You can refer to http://framework7.io/docs/init-app.html for more detailed specs.
for preventing cache you can use inline method (data-page attribute)
data-ignore-cache="true"
<a href="#" data-ignore-cache="true"><i class="fa fa-calendar"></i> sample link</a>
The simplest way is to define a variable timestamp and set it with Date.now() and give it to route path parameter with ?timestamp on every route path ending.
So in this case framework7 must load every html file on every browser reload again.
after your development and design is finished you can ment it out. This scenario you can use for every framework you use. it is not framework7 specific.
for examle:
var timestamp = Date.now();
routes = [
{
path: '/',
url: './index.html?'+timestamp,
},
{
path: '/about/',
url: './pages/about.html?'+timestamp,
},
{
path: '/form/',
url: './pages/form.html?'+timestamp,
},
{
path: '/page-loader-template7/:user/:userId/:posts/:postId/',
templateUrl: './pages/page-loader-template7.html?'+timestamp,
},
{
path: '/page-loader-ponent/:user/:userId/:posts/:postId/',
ponentUrl: './pages/page-loader-ponent.html?'+timestamp
}]
本文标签: javascriptframework7 prevent caching pages dataStack Overflow
版权声明:本文标题:javascript - framework7 prevent caching pages data - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1744055224a2525727.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论