Familiar scenarion...
* Upload a file and link a resource to it.
* Change the file... upload a new one of the same name
The old file is cached and it's anybody's guess when the users see the new version. I've done some poking about and it does look like Moodle is responsible (not 100%). It seems to do this regardless of cache settings. I'm surprised this hasn't been addressed.
Am I just missing something or is this one of those impossible to fix things??
In reply to Howard Miller
Re: Is updating a linked file meant to cache like that....?
by Helen Foster -
Hi Howard,
I found the following config setting mentioned in the discussion overwriting resource files:
// Seconds for files to remain in caches. Decrease this if you are worried
// about students being served outdated versions of uploaded files.
// $CFG->filelifetime = 86400;
If you find it helpful, perhaps you could add the information to Resources FAQ.
I found the following config setting mentioned in the discussion overwriting resource files:
// Seconds for files to remain in caches. Decrease this if you are worried
// about students being served outdated versions of uploaded files.
// $CFG->filelifetime = 86400;
If you find it helpful, perhaps you could add the information to Resources FAQ.

In reply to Helen Foster
Re: Is updating a linked file meant to cache like that....?
by Howard Miller -
Ahh... ok. The upshot is that file.php generates a "cache-control" header. The default is a whole day, so it's perhaps not surprising that this can cause some confusion. Setting it to 0 should turn the thing off. If that's a good idea is another matter entirely.
I'll add something to those docs.
Thanks Helen - again
I'll add something to those docs.
Thanks Helen - again
In reply to Howard Miller
Re: Is updating a linked file meant to cache like that....?
by sam marshall -
This is really beneficial for performance if your pages load a lot of things through file.php (images etc), so it might be better not to turn it off entirely. (Actually, Moodle should probably make an effort at sending these headers for more types of file...)
You might want to reduce it but keep it within the range of a typical user session; for example 1 hour (3600).
--sam
You might want to reduce it but keep it within the range of a typical user session; for example 1 hour (3600).
--sam