Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RedisCache fails to delete cached objects when f=None #1355

Closed
abastardi opened this issue Jun 9, 2016 · 0 comments
Closed

RedisCache fails to delete cached objects when f=None #1355

abastardi opened this issue Jun 9, 2016 · 0 comments

Comments

@abastardi
Copy link
Contributor

For background, see https://groups.google.com/d/msg/web2py/1LoXXrPlIGE/bX2u3CJ2BQAJ.

According to the book, calling cache.model(key, f=None) should cause key to be deleted from the cache. However, in gluon.contrib.redis_cache.RedisClient.__call__, setting f=None only deletes the cached object if it has expired.

This causes a problem with @cache.action because it relies on the f=None deletion method to delete pages that were cached with an invalid HTTP status.

We should change the behavior of the Redis cache to match that of the other cache models (i.e., setting f=None should always delete the key from the cache).

Also, for extra safety, perhaps @cache.action should delete pages with an invalid status via cache_model.clear(r'^%s$' % cache_key) rather than cache_model(cache_key, None).

mdipierro added a commit that referenced this issue Jul 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant