diff --git a/src/js/redirect-engine.js b/src/js/redirect-engine.js index c2e053a5c..4825588a8 100644 --- a/src/js/redirect-engine.js +++ b/src/js/redirect-engine.js @@ -266,13 +266,6 @@ const RedirectEngine = function() { this.resources = new Map(); this.reset(); this.resourceNameRegister = ''; - - // Internal use - this._missedQueryHash = ''; - this._src = ''; - this._srcAll = [ '*' ]; - this._des = ''; - this._desAll = [ '*' ]; }; /******************************************************************************/ @@ -281,9 +274,18 @@ RedirectEngine.prototype.reset = function() { this.rules = new Map(); this.ruleSources = new Set(); this.ruleDestinations = new Set(); + this.resetCache(); this.modifyTime = Date.now(); }; +RedirectEngine.prototype.resetCache = function() { + this._missedQueryHash = ''; + this._src = ''; + this._srcAll = [ '*' ]; + this._des = ''; + this._desAll = [ '*' ]; +}; + /******************************************************************************/ RedirectEngine.prototype.freeze = function() { @@ -594,6 +596,7 @@ RedirectEngine.prototype.fromSelfie = function(path) { this.rules = new Map(selfie.rules); this.ruleSources = new Set(selfie.ruleSources); this.ruleDestinations = new Set(selfie.ruleDestinations); + this.resetCache(); this.modifyTime = Date.now(); return true; });