Closed yorickreum closed 5 years ago
Hi Yorick, We've been using this course format for 2 years as the only course format (except for collapsibleweeks) and haven't noticed performance issues. However, we are running moodle with only 10k users and 1.5 k courses. Maybe problems arise with bigger instances, but none I am aware of. However after your post I've started investigating the possibility to use browser localStorage and sessionStorage to keep "keepstateoversession" feature, but that would no longer be "moodle session"-based but browser-session based, which I think is no big deal. I'm going to adapt the code in that way and push it on a new branch soon. Will you test it? Regards Jean-Roch from Belgium
Hi, I've pushed a new branch "browserpersistance" that uses javascript storage (session or local according to "keepstateoversession" setting. Could you test it and give me feedback? The work is not finalized, I still have to clean some code related to db implementation, adapt privacy handling and upgrade process to remove db entries. Regards
That was fast. Thanks a lot, we'll test it tomorrow!
Sorry, we couldn't test it as fast as wrote you.
We've installed it in our testing environment now. It works like a charm! The code also already looks really good.
Two things we recognised:
The setting now works vice versa than expected: If it's checked, meaning "state will be kept when user logs out", it's using session storage – if not checked, local storage. Shouldn't it be the other way round?
By saving the JSON-stringified data, we (in our opinion) get some overhead in the storage. It wouldn't be exactly necessary to store "true" for all of the expanded sections, storing the number should be enough? But since the code looks quite clean this way, it's maybe better to leave it like this. (I can't imagine it will cause any real harm.)
Thanks a lot! Yorick
Hi,
Keep me posted on your tests please Regards Jean-Roch
Integrated in last release, closing issue !
Hi there,
first of all: Thanks for this amazing plugin, this is going to make our Moodle-website better!
As our installation suffers peaks with up to 10.000 online users, we're a little bit concerned about the database reads/writes triggered by the plugin (since it's writing all the "section is open"-states – for all users, courses, sections – to the database at the moment).
The setting _formatcollapsibletopics | keepstateoversession still keeps all the data in the database, but deletes it when the user logs out.
Is there already any effort to reduce database writes?
In our opinion, it would be preferable to store this information not at the database but at the client-site (for example JavaScript local storage or session storage), at least if the "keep state over sessions"-setting is disabled. We don't see a use case where it's really necessary to share this information with different devices.
Kind regards from Germany + Let us know if we can help somehow! Yorick