From ad51a360cd9777b6ee1955f5af9c89c39e2b6bc1 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Mon, 19 Sep 2011 13:34:17 +0000 Subject: [PATCH] allow some filtering when clearing the requests cache --- source/Ox.UI/js/Core/Ox.Request.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/Ox.UI/js/Core/Ox.Request.js b/source/Ox.UI/js/Core/Ox.Request.js index cfd5bd5a..8b801a69 100644 --- a/source/Ox.UI/js/Core/Ox.Request.js +++ b/source/Ox.UI/js/Core/Ox.Request.js @@ -49,8 +49,14 @@ Ox.Request = function(options) { clearCache clear cached results () -> ... @*/ - clearCache: function() { - cache = {}; + clearCache: function(query) { + if (!query) { + cache = {}; + } else { + cache = Ox.filter(cache, function(val, key) { + return key.indexOf(query) == -1; + }); + } }, _leakCache: function() {