From 15e58709c8d30fcc9923cd84d46189735bc14114 Mon Sep 17 00:00:00 2001 From: Mark Johnson Date: Fri, 2 May 2025 16:39:22 +0100 Subject: [PATCH] MDL-85323 core: Don't cache the login page --- lib/weblib.php | 3 +-- login/index.php | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 09e8bde0a94..2bc0884725e 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1564,8 +1564,7 @@ function send_headers($contenttype, $cacheable = true) { @header('Expires: '); } else { // Do everything we can to always prevent clients and proxies caching. - @header('Cache-Control: no-store, no-cache, must-revalidate'); - @header('Cache-Control: post-check=0, pre-check=0, no-transform', false); + @header('Cache-Control: no-store, no-cache, must-revalidate, no-transform'); @header('Pragma: no-cache'); @header('Expires: Mon, 20 Aug 1969 09:23:00 GMT'); @header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); diff --git a/login/index.php b/login/index.php index 923439b56d0..9474a318c39 100644 --- a/login/index.php +++ b/login/index.php @@ -50,6 +50,7 @@ $context = context_system::instance(); $PAGE->set_url("$CFG->wwwroot/login/index.php"); $PAGE->set_context($context); $PAGE->set_pagelayout('login'); +$PAGE->set_cacheable(false); /// Initialize variables $errormsg = '';