如何在执行基于node-webkit的应用程序时禁用远程脚本和样式表的缓存

How to disable caching of remote scripts and stylesheets when executing node-webkit based applications?

本文关键字:程脚本 脚本 缓存 样式 执行 node-webkit 应用程序      更新时间:2023-09-26

我正在使用node-webkit从一个带有大量外部脚本和样式表的内部网站点创建一个桌面应用程序。我在调试时注意到的一个问题是,它似乎在不同的运行之间偶尔缓存外部脚本和样式表-有时它会加载最近修改的脚本,有时它不会打开地址栏并手动输入脚本路径,然后点击重新加载。有没有办法让它每次加载时都能得到一个新的依赖项副本?

包。

{
    "name": "name",
    "description": "description",
    "version": "0.1",
    "main": "https://path-to-intranet-site/",
    "node-remote": "https://path-to-intranet-site",
    "window": {
        "show": true,
        "toolbar": true,
        "frame": true,
        "position": "center",
        "width": 800,
        "height": 600,
        "min_width": 220,
        "min_height": 220
    }
}

尝试编辑包。Json格式如下:

{
    "name": "name",
    "description": "description",
    "version": "0.1",
    "main": "https://path-to-intranet-site/",
    "node-remote": "https://path-to-intranet-site",
    "webkit": {
         "page-cache":false
    },
    "window": {
        "show": true,
        "toolbar": true,
        "frame": true,
        "position": "center",
        "width": 800,
        "height": 600,
        "min_width": 220,
        "min_height": 220
    }
}

在Manifest格式的文档中,node-webkit wiki页面的page-cache默认为false。