diff --git a/django/core/cache/backends/filebased.py b/django/core/cache/backends/filebased.py index fe833336d0..6057f11ef7 100644 --- a/django/core/cache/backends/filebased.py +++ b/django/core/cache/backends/filebased.py @@ -116,7 +116,7 @@ class CacheClass(BaseCache): return try: - filelist = os.listdir(self._dir) + filelist = sorted(os.listdir(self._dir)) except (IOError, OSError): return