1. Jason Moiron
  2. johnny-cache
  3. Issues
Issue #54 resolved

JOHNNY_MIDDLEWARE_SECONDS doesn't change expiry

Anonymous created an issue

From reading the docs I expected JOHNNY_MIDDLEWARE_SECONDS to allow me to set a non zero value so I could expiry my cache after a set amount of time, but this didn't work. This seems to caused by line 333 of cache.py

{{{ if key is not None: self.cache_backend.set(key, val, 0, db) }}}

Where 0 is hard coded. IMO this should use the MIDDLEWARE_SECONDS settings to give the user control over this option. But if this is hard coded for a reason then I think the docs should be changed to explain why this is.