24 Commits

Author SHA1 Message Date
David Woloszyn
7679452caf MDL-77846 core: Make endpoint revision number checks stricter
In some places we prevented cache poisoning, in others we did not. We
also did not place any restriction on the minimum value for a revision.

This change introduces a new set of functions for configonly endpoints
which validates the revision numbers passed in. If the revision is
either too old, or too new, it is rejected and the file content is not
cached. The content is still served, but caching headers are not sent,
and any local storage caching is prevented.

The current time is used as the maximum version, with 60 seconds added
to allow for any clock skew between cluster nodes. Previously some
locations used one hour, but there should never be such a large clock
skew on a correctly configured system.

Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2023-10-04 01:24:19 +00:00
Simon Coggins
754313fbb8 MDL-46775: Fix call to unavailable function when loading an invalid JS file 2014-08-12 14:06:37 +12:00
Petr Škoda
6b32d6bc93 MDL-40995 simplify minify integration and fix all known issues 2013-08-03 17:16:17 +02:00
Petr Škoda
cb8108dd22 MDL-40545 convert js and theme resources to localcachedir 2013-07-20 14:10:25 +02:00
Petr Škoda
0238ca0d6e MDL-40563 use revisions for theme js cache files 2013-07-12 23:17:22 +02:00
Petr Skoda
979d320722 MDL-32825 try to improve atomicity of cache file operations in themes and javascript 2012-05-07 18:45:13 +02:00
Petr Skoda
8ab2974341 MDL-32683 improve and standardise JS serving 2012-05-05 18:16:50 +02:00
Petr Skoda
8475b9704f MDL-32683 fine tune theme javascript caching 2012-05-05 16:54:06 +02:00
Petr Skoda
ecbad2ad1c MDL-32683 use slashargument urls for theme javascript files 2012-05-05 15:31:27 +02:00
Petr Skoda
8c672cf9f3 MDL-32683 explicitly allow more caching of static content 2012-05-05 14:09:31 +02:00
Petr Skoda
7e9f1b63e5 MDL-26028 use X-Sendfile for theme images and javascript 2012-04-29 18:59:08 +02:00
Petr Skoda
d1f582d99c MDL-31079 detect js and css minimisation failures 2012-03-03 11:53:53 +01:00
Aparup Banerjee
3a9e6be55a Merge branch 'w46_MDL-30349_m22_filestatcaching' of git://github.com/skodak/moodle 2011-11-22 11:33:55 +08:00
Petr Skoda
e164a0dfea MDL-30349 clear file stat cache when adding new theme cache files
Hopefully this will resolve some cache reset problems.
2011-11-19 12:14:26 +01:00
Petr Skoda
c198390a49 MDL-30294 prevent notices and errors in theme files content
Theme images, css and JS are broken by PHP error messages which creates major problems for production sites with enabled displaying of errors because the files are cached indefinitely. It is better to send the errors and notices to logs only, in any case all developers must learn to use error logs.
2011-11-19 11:23:28 +01:00
Tom Lanyon
365bec4c06 MDL-28701 Change all uses of $CFG->dataroot/cache to $CFG->cachedir 2011-09-10 10:35:46 +02:00
Petr Skoda
aa603b14c7 MDL-28709 adding HTTP_IF_MODIFIED_SINCE and minor style tweaks 2011-08-19 16:32:30 +02:00
Tony Levi
ccc0fff941 MDL-28709: Performance: Send cache/contenttype headers with 304 responses 2011-08-19 16:23:08 +02:00
Petr Skoda
e1c2a211f2 MDL-28147 do not double cache theme css/js 2011-07-04 11:29:23 +02:00
Petr Skoda
8a7703ce53 MDL-25973 add missing charset 2011-01-14 09:32:17 +01:00
Petr Skoda
c426ef3aa5 MDL-23984 improvements of check_dir_exists() - replacing by make_upload_directory() in cases where we want to be sure that the dir is writable; removning now default create and recursive params to make code easier to read 2010-08-29 14:51:09 +00:00
Sam Hemelryk
a6338a134b themes MDL-22826 Some minor changes to improve the IE user experience 2010-07-07 09:10:10 +00:00
Sam Hemelryk
045f492c6b javascript-minify MDL-21435 Added Minify third party lib and integrated to with JavaScript and CSS serving 2010-05-19 02:15:16 +00:00
Petr Skoda
baeb20bba3 MDL-21400 thems and JS now using the same script naming convention and parameter style 2010-02-07 13:08:46 +00:00