xncbf / django-dynamodb-cache

Django cache backend for serverless
https://pypi.org/project/django-dynamodb-cache/
MIT License
31 stars 5 forks source link

`cache.set(key, value, None)` does not default to infinite/no expiry #18

Closed dan-lumafield closed 1 year ago

dan-lumafield commented 1 year ago

Hello! This is an awesome project -- really appreciate it!

I ported some code which had been using the django in-memory cache where a call similar to:

cache.set(key, value, None)

would result in an infinite cache expiration.

In django-dynamodb-cache it seems like this results in the cache picking up the default timeout value, which is either set in the settings.py or is 120 seconds.

I looked a bit through the code and it also seems like a concept of a non-expiring cache key isn't fully supported at the moment.

It would be great for this extension to support non-expiring caches, and if cache.set(key, value, None) could result in a non-expiring cache key.

Thanks!

xncbf commented 1 year ago

Thanks for reporting the issue! I will provide a patch as soon as possible.

dan-lumafield commented 1 year ago

Thank you!