Suor / django-cacheops

A slick ORM cache with automatic granular event-driven invalidation.
BSD 3-Clause "New" or "Revised" License
2.12k stars 227 forks source link

Why the keep_fresh parameter in cached_as does not default to True ? #424

Closed nMustaki closed 2 years ago

nMustaki commented 2 years ago

Hello Suor,

first thanks for your work, it's very helpful here ! I'd like to ask some help to understand why the keep_fresh parameter of cached_as does not default to True ? Why would we want to cache stale data ? Thanks !

Suor commented 2 years ago

In short:

Sometimes not caching will mean app will just hang up, which is worse than serving something stale.

You can take a look at original PR too https://github.com/Suor/django-cacheops/pull/302

nMustaki commented 2 years ago

Thanks you, that's a lot clearer !