Plugin AJAX slow to load

Plugin AJAX slow to load

by Ben Kahn -
Number of replies: 2

Hello, I just installed the Point of View plugin. https://moodle.org/plugins/block_point_view It works as expected but I noticed that the buttons it loads on the course page take about 15-20 seconds to appear on the course page (the rest of the elements on the page seem to load in a normal amount of time, within a second or two). I tested the same plugin on a sandbox and staging site (staging site is exact same Moodle version and plugin set) and on both of those sites the Point of View buttons load quickly.

I checked in Chrome developer tools on the network tab, and I can see a few processes that seem to be taking a long time and causing the delay, both calls from service.php. I think these are ajax calls that the plugin uses. I've never really run across this type of issue and am wondering if anyone has advice on how to troubleshoot further.


Average of ratings: -
In reply to Ben Kahn

Re: Plugin AJAX slow to load

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
As I doubt there are that many users about familiar with that plugin (I'm certainly not), it may be more useful to contact the authors (https://github.com/QuentinFombaron/moodle-block_point_view/issues)

However, I did have a quick look and there's some terrifying SQL at https://github.com/QuentinFombaron/moodle-block_point_view/blob/master/externallib.php#L228.  I wonder how well tested that is, especially if you have a large site. 

Do you have a 'slow query log' set up on your database? That might be worth investigating. 


Average of ratings: Useful (1)
In reply to Howard Miller

Re: Plugin AJAX slow to load

by Ben Kahn -
Howard, thank you for taking the time to reply. This is a brand-new plugin and it seems from a young (student) developer so I wouldn't be surprised if there are things that can be improved. I'm curious what you are seeing that gives you pause on the SQL side?

Drilling in the items on the Network tab I did see some queries (are you supposed to be able to see that in a browser?) so had the same thought about the slow query log... with the slow log time set to 1 second though I do not see anything related to the plugin.

I think I will restrict the block to a test group and reach out to the developer to see if we can help test it on a large site....