diff --git a/README.md b/README.md index 710a8a2..928e2c6 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,15 @@ URIs can be made relative to the individual LESS files with the global LESS conf ``` +Avoid caching +--- + +You can avoid caching by adding random "_t" parameter to URLs of less files. You can do this by adding next configuration option: + +```html + +``` + Installation and Setup ---------------------- diff --git a/lessc.js b/lessc.js index f4b2a47..3a26f55 100644 --- a/lessc.js +++ b/lessc.js @@ -7742,6 +7742,10 @@ function loadFile(originalHref, currentFileInfo, callback, env, modifyVars) { return; } + if (less.avoidCaching) { + href = href + (href.indexOf("?") === -1 ? "?" : "&") + "_t=" + (Math.random() * Math.pow(10, 16)); + } + doXHR(href, env.mime, function (data, lastModified) { // per file cache fileCache[href] = data;