Did you try timing it against the built-in cache functions Python provides?
eg docs.python.org/3/library/functools.html
It’s indeed a good way to introduce how to create custom decorators, but for this caching purpose, I’d believe the built-in implementation will be faster.