Embed code problem after drupal cache clearing
could you help me with this issue:
When someone put to his site generated code of h5p content from my Drupal 8 site, after every clearing drupal cache(for examp. "drush cr" command) on clients side(where embed code is inserted) instead the content appears:
"The website encountered an unexpected error. Please try again later." - message.
In the other hand drupal log messages showing next error:
"LogicException: The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early. Returned object class: Drupal\Core\Render\HtmlResponse. in Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (line 154 of /home/user/web/mysite.com/public_html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php)."
How to solve this issue? :/