As a follow-up to my earlier post about having problems with the AxKit 
caching mechanism, I've managed to poke through it to build up the 
following _kludge_.  It works (here), but there's definate "YMMV" attached 
to this one.

I'm posting primarily so that someone more intimate with the innards of 
AxKit can examine it a bit further and figure out why its actually doing 
it this way.  From tracing through the code a bit here, it seems that 
AxKit actually tries to serve up the document _twice_ when its cached 
(once from cache in 'run_axkit_engine', and once in 'deliver_to_browser').  
Quirk here is also that we spit out _two_ sets of HTTP headers, which 
probably isn't right either.

Worse yet, I'll take it from the lack of other people commenting on this, 
that I'm likely the only poor sod out here who's experiencing this 
problem.  If so, how come? (it looks like a code-flow bug to me).

-- 
Graham TerMarsch
Howling Frog Internet Development, Inc.   http://www.howlingfrog.com
diff -r -c AxKit-1.6.orig/lib/AxKit.pm AxKit-1.6/lib/AxKit.pm
*** AxKit-1.6.orig/lib/AxKit.pm	Sat Jun  8 05:03:10 2002
--- AxKit-1.6/lib/AxKit.pm	Tue Sep 17 20:07:58 2002
***************
*** 269,275 ****
              tie *STDOUT, 'Apache', $r;
          }
  
!         deliver_to_browser($r, $result_code);
      };
      my $E = $@;
      unless ($E) {
--- 269,281 ----
              tie *STDOUT, 'Apache', $r;
          }
  
! 	my $KLUDGE = $AxKit::KLUDGE_CACHE_DELIVERED;
! 	undef $AxKit::KLUDGE_CACHE_DELIVERED;
! 	if (!defined $KLUDGE)
! 	{
!         return deliver_to_browser($r, $result_code);
! 	}
! 	$KLUDGE;
      };
      my $E = $@;
      unless ($E) {
***************
*** 400,406 ****
  
      if (!$recreate) {
          AxKit::Debug(1, "delivering cached copy - all conditions met");
!         return $cache->deliver();
      }
  
      AxKit::Debug(1, "some condition failed. recreating output");
--- 406,414 ----
  
      if (!$recreate) {
          AxKit::Debug(1, "delivering cached copy - all conditions met");
! 	$AxKit::KLUDGE_CACHE_DELIVERED = $cache->deliver();
! 	return $AxKit::KLUDGE_CACHE_DELIVERED;
! 	#return $cache->deliver();
      }
  
      AxKit::Debug(1, "some condition failed. recreating output");

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to