my $net_timeout;
+my $cache;
sub child_init {
OpenSRF::System->bootstrap_client( config_file => $bs_config );
return unless $ac_data;
+ $cache = OpenSRF::Utils::Cache->new;
+
my $ac_handler = $ac_data->{module};
$net_timeout = $ac_data->{timeout} || 3;
child_init() unless $handler; # why isn't apache doing this for us?
return Apache2::Const::NOT_FOUND unless $handler;
+ # if this memcache key is set, added content lookups are disabled
+ if( $cache->get_cache('ac.no_lookup') ) {
+ $logger->info("added content lookup disabled");
+ return Apache2::Const::NOT_FOUND;
+ }
+
+
my( undef, $data, $format, $key ) = split(/\//, $r->path_info);
my $err;
--- /dev/null
+#!/usr/bin/perl
+use strict; use warnings;
+
+use OpenSRF::AppSession;
+use OpenSRF::System;
+use OpenSRF::Utils::SettingsClient;
+use OpenSRF::Utils::Cache;
+
+my $config = shift;
+my $command = shift;
+die <<USAGE
+
+ Enables/disables added content lookups in apache. This does not (currently)
+ include jacket image lookups, which are Apache rewrites
+
+ usage: perl $0 <bootstrap_config> [enable|disable]
+
+USAGE
+ unless $command;
+
+OpenSRF::System->bootstrap_client(config_file => $config);
+
+my $cache = OpenSRF::Utils::Cache->new;
+$cache->put_cache('ac.no_lookup', 1) if $command eq 'disable';
+$cache->delete_cache('ac.no_lookup') if $command eq 'enable';
+
+