Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
- fix for 'do not write to cache' rule. - do not read from cache if byte[] array is still filled from response object (will do less IO)
orbiter2bc3cba6f100
diff --git a/source/de/anomic/search/Switchboard.java b/source/de/anomic/search/Switchboard.javaindex 84e19b51d..98a18e4e1 100644--- a/source/de/anomic/search/Switchboard.java+++ b/source/de/anomic/search/Switchboard.java@@ -1639,9 +1639,10 @@ public final class Switchboard extends serverSwitch {// PARSE CONTENTfinal long parsingStartTime = System.currentTimeMillis();- byte[] b = null;- try {- // fetch the document+ // fetch the document from the response+ byte[] b = response.getContent();+ if (b == null) try {+ // fetch the document from cacheb = Cache.getContent(response.url());if (b == null) {this.log.logWarning("the resource '" + response.url() + "' is missing in the cache.");diff --git a/source/net/yacy/repository/LoaderDispatcher.java b/source/net/yacy/repository/LoaderDispatcher.javaindex 6679906ed..e33f01fcf 100644--- a/source/net/yacy/repository/LoaderDispatcher.java+++ b/source/net/yacy/repository/LoaderDispatcher.java@@ -264,6 +264,12 @@ public final class LoaderDispatcher {if (protocol.equals("smb")) response = smbLoader.load(request, true);if (response != null) {// we got something. Now check if we want to store that to the cache+ // first check looks if we want to store the content to the cache+ if (!crawlProfile.storeHTCache()) {+ // no caching wanted. Thats ok, do not write any message+ return response;+ }+ // second check tells us if the protocoll tells us something about cachingString storeError = response.shallStoreCacheForCrawler();if (storeError == null) {try {