What is a cache, and how does it affect Moodle?
During the first half of this year we’ve had a number of times where problems with Moodle has been traced to cache issues.
A cache is a hardware or software component that stores data so future requests for that data can be served faster; the data stored in a cache might be the result of an earlier computation, or the duplicate of data stored elsewhere.
Servers have their own cache, and Moodle has cache settings, but local servers will have settings too, and even the users browser.
All this is done to make things faster, but the downside is it can make things ‘older’ too.
Here’s a couple of the things to look for…
- Users not seeing updated pages after they have been edited.This can be the result of caches living too long, and serving out-of-date pages instead of new ones.
For users, they can type a question mark on the end of their URL in the address bar (this is a standard way to force most browsers to ‘get the message’ and fetch the page afresh).
Of course browsers also have a clear cache option – although many users will have no idea where this is 🙁
- Settings are not being updated by admin, or everyone is seeing old pagesWe’ve seen a couple of instances where data is being cached so aggressively that it’s affecting the changes on a Moodle site. To ensure you have the latest pages, you can restart the server, or sometimes just clear the cache files from the server (a bit too technical for this article). Either way, restarting the service will often but not always) resolve the problem.