View | Details | Raw Unified | Return to bug 6019
Collapse All | Expand All

(-)a/C4/Biblio.pm (-1 / +4 lines)
Lines 136-142 eval { Link Here
136
            servers    => [$servers],
136
            servers    => [$servers],
137
            key_prefix => C4::Context->config('memcached_namespace') || 'koha',
137
            key_prefix => C4::Context->config('memcached_namespace') || 'koha',
138
        };
138
        };
139
        memoize_memcached( 'GetMarcStructure', memcached => $memcached, expire_time => 600 );    #cache for 10 minutes
139
        memoize_memcached( 'GetMarcStructure', memcached => $memcached, expire_time => 60000 );    #cache for 1000 minutes
140
        memoize_memcached( 'GetAuthorisedValueDesc', memcached => $memcached, expire_time => 60000 );    #cache for 1000 minutes
141
        memoize_memcached( 'GetMarcFromKohaField', memcached => $memcached, expire_time => 60000 );    #cache for 1000 minutes
142
        memoize_memcached( 'get_biblio_authorised_values', memcached => $memcached, expire_time => 60000 );    #cache for 1000 minutes
140
    }
143
    }
141
};
144
};
142
145
(-)a/C4/Branch.pm (+16 lines)
Lines 24-29 use C4::Koha; Link Here
24
24
25
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
25
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
26
26
27
eval {
28
    my $servers = C4::Context->config('memcached_servers');
29
    if ($servers) {
30
        require Memoize::Memcached;
31
        import Memoize::Memcached qw(memoize_memcached);
32
 
33
        my $memcached = {
34
            servers    => [ $servers ],
35
            key_prefix => C4::Context->config('memcached_namespace') || 'koha',
36
        };
37
38
        memoize_memcached('GetBranches',memcached => $memcached, expire_time => 600000);
39
        memoize_memcached('GetBranchName',memcached => $memcached, expire_time => 600000);
40
    }
41
};
42
27
BEGIN {
43
BEGIN {
28
	# set the version for version checking
44
	# set the version for version checking
29
	$VERSION = 3.02;
45
	$VERSION = 3.02;
(-)a/C4/Context.pm (+16 lines)
Lines 20-25 use strict; Link Here
20
use warnings;
20
use warnings;
21
use vars qw($VERSION $AUTOLOAD $context @context_stack);
21
use vars qw($VERSION $AUTOLOAD $context @context_stack);
22
22
23
eval {
24
    my $servers = C4::Context->config('memcached_servers');
25
    if ($servers) {
26
        require Memoize::Memcached;
27
        import Memoize::Memcached qw(memoize_memcached);
28
 
29
        my $memcached = {
30
            servers    => [ $servers ],
31
            key_prefix => C4::Context->config('memcached_namespace') || 'koha',
32
        };
33
34
        memoize_memcached('preference', memcached => $memcached, expire_time => 600000); #cache for 10 minutes
35
        memoize_memcached('marcfromkohafield', memcached => $memcached, expire_time => 600000); #cache for 10 minutes
36
    }
37
};
38
23
BEGIN {
39
BEGIN {
24
	if ($ENV{'HTTP_USER_AGENT'})	{
40
	if ($ENV{'HTTP_USER_AGENT'})	{
25
		require CGI::Carp;
41
		require CGI::Carp;
(-)a/C4/Koha.pm (-2 / +18 lines)
Lines 73-79 BEGIN { Link Here
73
}
73
}
74
74
75
# expensive functions
75
# expensive functions
76
memoize('GetAuthorisedValues');
76
    
77
eval {
78
    my $servers = C4::Context->config('memcached_servers');
79
    if ($servers) {
80
        require Memoize::Memcached;
81
        import Memoize::Memcached qw(memoize_memcached);
82
 
83
        my $memcached = {
84
            servers    => [ $servers ],
85
            key_prefix => C4::Context->config('memcached_namespace') || 'koha',
86
        };
87
88
        memoize_memcached('GetKohaAuthorisedValues',memcached => $memcached, expire_time => 600000);
89
        memoize_memcached('GetAuthorisedValues',memcached => $memcached, expire_time => 600000);
90
        memoize_memcached('GetItemTypes',memcached => $memcached, expire_time => 600000);
91
        memoize_memcached('getitemtypeimagelocation',memcached => $memcached, expire_time => 600000);
92
    }
93
};
77
94
78
=head1 NAME
95
=head1 NAME
79
96
80
- 

Return to bug 6019