]> git.wh0rd.org Git - tt-rss.git/commitdiff
headline cache fixes
authorAndrew Dolgov <fox@madoka.spb.ru>
Wed, 21 Nov 2007 09:15:14 +0000 (10:15 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Wed, 21 Nov 2007 09:15:14 +0000 (10:15 +0100)
feedlist.js
viewfeed.js

index acb46e9395a5ce0e64c068078c8cbd92f0715926..57bfdcd1e84bd40c868afd3a097648b76f855fd0 100644 (file)
@@ -148,9 +148,17 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
 
                if (unread_ctr && !page_offset) {
                        unread_ctr = unread_ctr.innerHTML;
-                       cache_check = cache_check_param("F:" + feed, unread_ctr);
-                       debug("headline cache check: " + cache_check + " (F:" + feed + 
-                               " P: " + unread_ctr);
+
+                       var cache_prefix = "";
+                               
+                       if (is_cat) {
+                               cache_prefix = "C:";
+                       } else {
+                               cache_prefix = "F:";
+                       }
+
+                       cache_check = cache_check_param(cache_prefix + feed, unread_ctr);
+                       debug("headline cache check: " + cache_check);
                }
 
                if (cache_check) {
@@ -171,7 +179,7 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
                                } 
                        }
 
-                       f.innerHTML = cache_find_param("F:" + feed, unread_ctr);
+                       f.innerHTML = cache_find_param(cache_prefix + feed, unread_ctr);
 
                        var query = "backend.php?op=rpc&subop=getAllCounters";
 
index 1688680fcf26a32b6390049ffcbe2e31a8c23e9f..9c41992bd4e91ebec5720fdef769fa894b90209d 100644 (file)
@@ -105,7 +105,15 @@ function headlines_callback2(transport, active_feed_id, is_cat, feed_cur_page) {
                                if (headlines) {
                                        f.innerHTML = headlines.firstChild.nodeValue;
 
-                                       cache_inject("F:" + active_feed_id,
+                                       var cache_prefix = "";
+
+                                       if (is_cat) {
+                                               cache_prefix = "C:";
+                                       } else {
+                                               cache_prefix = "F:";
+                                       }
+
+                                       cache_inject(cache_prefix + active_feed_id,
                                                headlines.firstChild.nodeValue, headlines_unread);
 
                                } else {