Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

FIxes to make cache parameter behave more as expected

  • Loading branch information...
commit 38a7def0f0266b4ca0581902fcfc5826a0e1e814 1 parent 55f21d3
moodler authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/weblib.php
8 lib/weblib.php
View
@@ -1122,7 +1122,13 @@ function print_header ($title="", $heading="", $navigation="", $focus="", $meta=
$direction = " dir=\"ltr\"";
}
- if (!$cache) { // Do everything we can to prevent clients and proxies caching
+ if ($cache) {
+ @session_cache_limiter('private');
+ @header('Cache-Control: private');
+ @header('Pragma: ');
+ @header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
+ @header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
+ } else { // Do everything we can to prevent clients and proxies caching
@header('Expires: Mon, 20 Aug 1969 09:23:00 GMT');
@header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
@header('Cache-Control: no-store, no-cache, must-revalidate');
Please sign in to comment.
Something went wrong with that request. Please try again.