The Backend as well as the frontend queries for storages many times.
There are most times not many storages within the system.
The idea is, to create all storages objects at once as soon as the first one is requested and store them in memory...
Therefore many queries may be omitted.
[TASK] Optimize retrieval of Storages
Analysing the SQL logs shows that there are very much queries to the
sys_file_storage even though the information is quite static. Since
there in general there are not much storages - in most cases it only
will be fileadmin/.
This change will get all storage records from database with one call
and cache this in a runtime cache. Afterwards all requests are resolved
by the static member variable of the StorageRepository. If no storage
is present the default storage is created
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Stefan Froemken
Tested-by: Stefan Froemken
Reviewed-by: Sebastian Fischer
Tested-by: Sebastian Fischer
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter