Attempts to prevent browser caching by adding '?v=' to the end of specified filenames in specified files.
npm install cache-refresh.refreshconfig file in the root directory.
?v=1). If it already has a query string for the version, it will add 1 to it, it will output to a file called "differentFile.html"
json
{
"inputFile": "myFile.html",
"scriptFile": "myScript.js",
"outputFile": "differentFile.html"
}
`
#### Example #2:
This example represents a configuration with multiple files to update the versions on.
In this example, Cache Refresher will search "myFile1.html" and "myFile2.html" for instances of "myScript.js" and append a query string (?v=1). If it already has a query string for the version, it will add 1 to it, "myFile1.html" will output to a file called "differentFile.html", but "myFile2.html" will be replaced with the new file with updated version numbers.
`json
[
{
"inputFile": "myFile1.html",
"scriptFile": "myScript.js",
"outputFile": "differentFile.html"
},
{
"inputFile": "myFile2.html",
"scriptFile": "myScript.js"
}
]
`
#### Example #3:
This example represents a configuration with one file to update the versions on with multiple script files.
In this example, Cache Refresher will search "myFile.html" for instances of "myScript.js", "myStyle.css", "myStyle2.css", "anotherScript.js" and append a query string (?v=1). If it already has a query string for the version, it will add 1 to it. "myFile.html" will be replaced with the new file with updated versions.
`json
{
"inputFile": "myFile.html",
"scriptFile": [
"myScript.js",
"myStyles.css",
"myStyles2.css",
"anotherScript.js"
]
}
`
#### Example #4:
This example represents a configuration with multiple files to update the versions on with multiple script files.
In this example, Cache Refresher will search "myFile1.html" for instances of "myScript.js" and will search "myFile2.html" for instances of "myScript.js", "myStyles.css", "myStyles2.css", and "anotherScript.js". It will append a query string (?v=1) to these instances. If it already has a query string for the version, it will add 1 to it, "myFile1.html" will output to a file called "differentFile.html", but "myFile2.html" will be replaced with the new file with updated version numbers.
``json