in any event, the 3-tuple of (mode, prefix, suffix) is what uniquely defines a course.  So to faithfully replicate the QuerySet filter you'll need to add mode to the cache key.