@@ -, +, @@ --- C4/XSLT.pm | 8 ++++++++ t/db_dependent/XSLT.t | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) --- a/C4/XSLT.pm +++ a/C4/XSLT.pm @@ -29,6 +29,7 @@ use C4::Biblio qw( GetAuthorisedValueDesc GetFrameworkCode GetMarcStructure ); use Koha::AuthorisedValues; use Koha::ItemTypes; use Koha::RecordProcessor; +use Koha::Caches; use Koha::XSLT::Base; use Koha::Libraries; use Koha::Recalls; @@ -423,6 +424,12 @@ sub CustomXSLTExportList { my $opac = shift; # opac (1) vs intranet (0) return [] if $opac && C4::Context->preference('OpacExportOptions') !~ /custom/; + # Check the cache first + my $cache = Koha::Caches->get_instance; + my $key = $opac ? 'CustomXSLTExportListOPAC' : 'CustomXSLTExportListIntra'; + my $cached_val = $cache->get_from_cache($key); + return $cached_val if $cached_val; + my @tabFiles; my $dir = C4::Context->config( $opac ? 'opachtdocs' : 'intrahtdocs') . @@ -459,6 +466,7 @@ sub CustomXSLTExportList { push @tabFiles, \%row; } } + $cache->set_in_cache( $key, [ @tabFiles ] ); return \@tabFiles; } 1; --- a/t/db_dependent/XSLT.t +++ a/t/db_dependent/XSLT.t @@ -1,4 +1,3 @@ -original #!/usr/bin/perl # This file is part of Koha. --