- πΊπΈUnited States illeace
If I'm reading the H5P core library's validToken() function (vendor/h5p/h5p-core/h5p.classes.php line 3351) correctly, whenever a token is generated, it is going to be valid for at least 12 hours and up to 24 hours. Rather than disabling caching completely, what if the max-age was set to 12 hours?
- Merge request !46Issue #3036486: Set max-age of 12 hours to ensure results token has not expired β (Merged) created by Unnamed author
- πΊπΈUnited States illeace
OK, as @pjotr.savitski suggests, I've created an issue fork that sets the max age to align with the token expiration time. This ensures that the Drupal cache never serves an H5P with an already-expired token. This is ready to be tested, but a bit time-consuming since it involves waiting for 12 hours for the cache to expire.
- πΊπΈUnited States illeace
The help simplify testing a bit, here's the test I've been using:
- Make sure Drupal's caching is enabled
- Create a Question Set H5P, or any other interactive that has a "Finish" button to submit results.
- Clear the Drupal cache.
- Make sure you are a logged in user and load a page that displays that H5P (it could be the normal node page or the embed URL). Start a timer as soon as the page loads.
- Open your browser's network inspector, set it to filter for "set-finished.json" to exclude any network activity aside from that callback URL, which is where your H5P "finished" data gets posted to.
- Complete the H5P and click the Finish button. You should see an item appear in the network inspector.
- Click that network item and ensure the response is JSON data with contents of
{"success":true}
- Now the boring par ... wait 12 hours and reload the page.
- Repeat the steps above to ensure the "set-finished.json" response is still
{"success":true}
- First commit to issue fork.
-
sim_1 β
committed 7f2f64fb on 2.0.x authored by
illeace β
Issue #3036486 by amourow, pjotr.savitski, illeace, maya maier: Results...
-
sim_1 β
committed 7f2f64fb on 2.0.x authored by
illeace β
Now that this issue is closed, please review the contribution record.
As a contributor, attribute any organization helped you, or if you volunteered your own time.
Maintainers, please credit people who helped resolve this issue.