@lumieducation/h5p-server
can be improved:CachedLibraryStorage
class can be used to cache the most common calls to the library storage. This will improve the overall performance of the library quite a bit, as many functions need library metadata, semantics or language files, which they get from the library storage. When used for complex content types like Course Presentation, the GET /ajax?action=libraries
endpoint becomes around 40x faster if you use the cached library storage!cache-manager
to abstract the caching, so you can pass in any of the store engines supported by it (e.g. redis, mongodb, fs, memcached). See the documentation page of cache-manager
for more details.@lumieducation/h5p-server
to serve the library files (JavaScript and CSS files used by the actual content types) to the browser of the user, it is also possible to serve them directly, as they are simple static files.new FileLibraryStorage('/directory/in/filesystem')
/directory/in/filesystem
. You can simply serve this directory under the URL specified in IH5PConfig.librariesUrl
(defaults to /libraries
). If you put this directory into a NFS storage or a shared volume, you can even use different machines to serve the library files (vertical scaling)!@lumieducation/h5p-server
in a setup in which multiple instances of it are executed in parallel (on a single machine to make use of multi-core processors or on multiple machines). When doing this, pay attention to this:FileContentStorage
and DirectoryTemporaryFileStorage
are not suitable for production use, as they suffer from serious scaling issues when listing content objects. They should only be used for development and testing purposes or in very small deployments.