diff --git a/src/General/Index.coffee b/src/General/Index.coffee index c61f40e5b..74a4dfaab 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -431,7 +431,7 @@ Index = Index.req = $.ajax "//a.4cdn.org/#{g.BOARD}/catalog.json", onloadend: (e) -> Index.load e, state , - whenModified: true + whenModified: 'Index' $.addClass Index.button, 'fa-spin' load: (e, state) -> diff --git a/src/General/lib/$.coffee b/src/General/lib/$.coffee index 04ca0b1e6..921da3ea0 100755 --- a/src/General/lib/$.coffee +++ b/src/General/lib/$.coffee @@ -64,8 +64,8 @@ $.ajax = do -> options.onerror?() return if whenModified - r.setRequestHeader 'If-Modified-Since', lastModified[url] if url of lastModified - $.on r, 'load', -> lastModified[url] = r.getResponseHeader 'Last-Modified' + r.setRequestHeader 'If-Modified-Since', lastModified[whenModified][url] if lastModified[whenModified]?[url]? + $.on r, 'load', -> (lastModified[whenModified] or= {})[url] = r.getResponseHeader 'Last-Modified' if /\.json$/.test url r.responseType = 'json' $.extend r, options diff --git a/src/Monitoring/ThreadStats.coffee b/src/Monitoring/ThreadStats.coffee index 52363ef60..8732ae706 100755 --- a/src/Monitoring/ThreadStats.coffee +++ b/src/Monitoring/ThreadStats.coffee @@ -75,7 +75,7 @@ ThreadStats = return ThreadStats.timeout = setTimeout ThreadStats.fetchPage, 2 * $.MINUTE $.ajax "//a.4cdn.org/#{ThreadStats.thread.board}/threads.json", onload: ThreadStats.onThreadsLoad, - whenModified: true + whenModified: 'ThreadStats' onThreadsLoad: -> return unless Conf["Page Count in Stats"] and @status is 200 diff --git a/src/Monitoring/ThreadUpdater.coffee b/src/Monitoring/ThreadUpdater.coffee index e884e8494..5466dd227 100755 --- a/src/Monitoring/ThreadUpdater.coffee +++ b/src/Monitoring/ThreadUpdater.coffee @@ -241,7 +241,7 @@ ThreadUpdater = onloadend: ThreadUpdater.cb.load timeout: $.MINUTE , - whenModified: true + whenModified: 'ThreadUpdater' updateThreadStatus: (type, status) -> return unless hasChanged = ThreadUpdater.thread["is#{type}"] isnt status