diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 1ad465b22..9717041f1 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -289,6 +289,7 @@ Index = Index.scrollToIndex() parse: (pages, pageNum) -> + $.cleanCache (url) -> /^\/\/a\.4cdn\.org\//.test url Index.parseThreadList pages Index.buildThreads() Index.sort() diff --git a/src/General/lib/$.coffee b/src/General/lib/$.coffee index f0c485117..2a0309032 100755 --- a/src/General/lib/$.coffee +++ b/src/General/lib/$.coffee @@ -72,9 +72,9 @@ $.ajax = do -> r.send form r -$.cache = do -> +do -> reqs = {} - (url, cb, options) -> + $.cache = (url, cb, options) -> if req = reqs[url] if req.readyState is 4 cb.call req, req.evt @@ -93,6 +93,10 @@ $.cache = do -> $.on req, 'abort error', rm req.callbacks = [cb] reqs[url] = req + $.cleanCache = (testf) -> + for url of reqs when testf url + delete reqs[url] + return $.cb = checked: ->