Too many Data base Requests when using H5P content

Hello, thanks for your cool learning tools!

I have a few problems though:

1) Data base Requests:
An empty page on my website has 23 DB requests, however when i put one H5P Flashcard on it, the number of DB requests increases to 53; if the number of flashcards is 3, the number of requests is 87. So if I want 33 flashcards (33 Russian letters) on my page, it will be 567 Db requests.
[this issue exists in all H5P content, with makes it difficult to mass produce useful contact]

Question: what can I do about it now and do you plan to do anything about it?

2) Could you make it possible to put different audio, texts, and images on different sides of the flashcard?

Thanks in advance.

icc's picture

1) Which platform are you using, Drupal, WordPress or Moodle?
Note that H5P do more queries the first time you save content, the second time viewing the content there should be no more than 3 to 5 queries depending on the platform. On systems not requiring logged in users, you should be able to cache the page reducing queries to 0 for anonymous users.
Please note that all queries done are required for H5P to work correctly.

2) If you create a well-described feature request it will be considered.

Hello! Thank you for your answer.

I am using WordPress.

I created a test page where I put 33 H5P dialogue cards ( I excluded this page from my cache plugin WP Rocket because everything used to be broken.

In fact, GTmetrics showed an exaggerated number of DB requests as opposed to WebPageTest.



Although GTmetrics shows inaccurate data, still the number of DB requests increases, though not so drastically as GTmetrics shows.

So, could you advise how to reduce the loading time on this particular page with H5P content now that I can't use my cache plugin WP Rocket because of the reason above?

Thank you.

icc's picture

Many of these requests are due to the fact that the content has to be wrapped in an iframe to avoid conflicts with the rest of the page. If you enable caching of static files(.js, .css, .html, .mp4, .jpg, .png, etc.) in your web server almost none of requests will actually hit your server. The files will only be requested for the first iframe and then the rest will be loaded from the browser cache. If you open the network tab in the browser you should be able to verify this:

You should try checking the access log of your web server to see how much resources are actually spent on a user. Many of the online diagnosis/benchmark tools are often just an indicator of how your page is doing and performing on the front end. Many requests doesn't necessarily mean there's something wrong.