Bug 38454: Flush memory cache before every API request
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
(cherry picked from commit 775d609af4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
3fef670e60
commit
2f0d336c19
|
|
@ -62,6 +62,17 @@ sub startup {
|
|||
if C4::Context->preference('AccessControlAllowOrigin');
|
||||
}
|
||||
);
|
||||
$self->hook(
|
||||
around_action => sub {
|
||||
my ($next, $c, $action, $last) = @_;
|
||||
|
||||
# Flush memory caches before every request
|
||||
Koha::Caches->flush_L1_caches();
|
||||
Koha::Cache::Memory::Lite->flush();
|
||||
|
||||
return $next->();
|
||||
}
|
||||
);
|
||||
|
||||
# Force charset=utf8 in Content-Type header for JSON responses
|
||||
$self->types->type( json => 'application/json; charset=utf8' );
|
||||
|
|
|
|||
Loading…
Reference in New Issue