Problem/Motivation
Every GET of CourseController::activity() has side effects: TrainingManager::getRequestedLessonStatus() checks the lesson take access and saves the student's position, and AnswerForm::buildForm() closes lessons over their time limit. A Dynamic Page Cache hit would skip all of it.
The page stays uncached only because FormBuilder gives the form token max-age 0 when a form sets no top-level max-age, a BC layer to be removed after #3395157. A non-zero max-age set in AnswerForm::buildForm() or in an activity plugin's answeringForm() would make the page cacheable.
Proposed resolution
Set max-age 0 on the render array returned by CourseController::activity(). No behavior change: the page is already uncached, and fragments such as the activity view and blocks keep their render cache.
Comments