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

StackOverflow https://stackoverflow.com/questions/15628966

I'm using node-webkit to create a desktop application from an intranet site with a lot of external scripts and stylesheets. An issue I've noticed when debugging is that it seems to cache the external scripts and stylesheets sporadically between different runs - sometimes it will load a recently modified script and other times it will not without turning on the addressbar and typing the script path in manually then hitting reload. Is there any way to make it so every time it loads it is getting a fresh copy of the dependencies?

The package.json I'm using is below:

{
    "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
    }
}
有帮助吗?

解决方案

try to edit package.json as follow:

{
    "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
    }
}

其他提示

In the documentation of Manifest format page-cache by default is false in the node-webkit wiki page.

Search in page for page-cache is is a little down.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top