nullcache.py 626 B

1234567891011121314151617181920212223
  1. """
  2. flask_caching.backends.null
  3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. The null cache backend. A caching backend that doesn't cache.
  5. :copyright: (c) 2018 by Peter Justin.
  6. :copyright: (c) 2010 by Thadeus Burgess.
  7. :license: BSD, see LICENSE for more details.
  8. """
  9. from flask_caching.backends.base import BaseCache
  10. class NullCache(BaseCache):
  11. """A cache that doesn't cache. This can be useful for unit testing.
  12. :param default_timeout: a dummy parameter that is ignored but exists
  13. for API compatibility with other caches.
  14. """
  15. def has(self, key):
  16. return False