-
Improvement
-
Resolution: Fixed
-
Major
-
3.6.1, 3.7
-
MOODLE_36_STABLE, MOODLE_37_STABLE
-
MOODLE_37_STABLE
-
MDL-64348-master -
At the moment when we fetch templates via ajax we do so one at a time because the client parses each template individually as it receives it and then fetches each other template it needs as it finds out that it needs them during the parsing.
This can result in 10s of network requests to the server to render a single template that has lots of other embedded templates.
However often times we know that the single template can't be rendered without all of the subsequent templates so rather than send back a single template the server should pre-parse the template being requested to find all of the other templates that are required to render this one and should send those back to the client in the same request.
This would allow the client to get all of the templates it needs in a single network request rather than in multiple subsequent requests.
This would be a massive win both in terms of number of requests and speed of template rendering for the client.