Index: /trunk/plugins/nikto_core.plugin
===================================================================
--- /trunk/plugins/nikto_core.plugin	(revision 412)
+++ /trunk/plugins/nikto_core.plugin	(revision 413)
@@ -1930,5 +1930,5 @@
 #######################################################################
 sub cache_add {
-    unless (defined $CLI{'nocache'}) {
+    if ((!defined $CLI{'nocache'}) && (!defined $flags->{'nocache'})) {
         my $method   = shift;
         my $code     = shift;
@@ -1939,11 +1939,11 @@
 
         my $key =
-          LW2::md5(  $mark->{'ip'} .
-                   $mark->{'hostname'} .
-                   $mark->{'port'} .
-                   $mark->{'ssl'} . 
-                   $method . 
-                   $uri . 
-                   $postdata);
+          LW2::md5(  $mark->{'ip'}
+                   . $mark->{'hostname'}
+                   . $mark->{'port'}
+                   . $mark->{'ssl'}
+                   . $method
+                   . $uri
+                   . $postdata);
 
         $CACHE{$key}{'method'}  = $method;
@@ -1955,4 +1955,10 @@
 #######################################################################
 sub cache_fetch {
+
+    # quick exit if cache is disabled
+    if ((defined $CLI{'nocache'}) || (defined $flags->{'nocache'})) {
+        return 0;
+    }
+
     my $method   = shift;
     my $uri      = shift;
@@ -1960,11 +1966,11 @@
     my ($mark)   = @_;
     my $key =
-      LW2::md5(  $mark->{'ip'} .
-               $mark->{'hostname'} . 
-               $mark->{'port'} . 
-               $mark->{'ssl'} . 
-               $method . 
-               $uri . 
-               $postdata);
+      LW2::md5(  $mark->{'ip'}
+               . $mark->{'hostname'}
+               . $mark->{'port'}
+               . $mark->{'ssl'}
+               . $method
+               . $uri
+               . $postdata);
 
     if ($CACHE{$key}{'code'} ne '') {
@@ -2009,12 +2015,10 @@
     # Check cache
     my $incache = 0;
-    if ((!defined $CLI{'nocache'}) && (!defined $flags->{'nocache'})) {
-        nprint("- Retrieving $uri from cache.", "v");
-        ($incache, my $code, my $content) =
-          cache_fetch($request{'whisker'}->{'method'}, $uri, $data, $mark);
-        if ($incache) {
-            $result{'whisker'}->{'code'} = $code;
-            $result{'whisker'}->{'data'} = $content;
-        }
+    nprint("- Checking $uri in cache.", "d");
+    ($incache, my $code, my $content) =
+      cache_fetch($request{'whisker'}->{'method'}, $uri, $data, $mark);
+    if ($incache) {
+        $result{'whisker'}->{'code'} = $code;
+        $result{'whisker'}->{'data'} = $content;
     }
 
