thadeusb/flask-cache — pull request #71 by baubie (2013-09-19 14:35:49+00:00)
Title: Allow deleting parameterless memoized caches

I have some functions that take no parameters that I'm caching using memoize(). They typically expire in 48 hours (fairly static), but if I update something, I want to manually delete and refresh the cache. Prior to this patch, the following code would cause the cache of myFunc() to ignore the timeout parameter in the memoize() decorator:

```python
cache.delete_memoized(myFunc)
myFunc()
```

This is because the version_key had no timeout set, so it was expiring in 240 seconds with my Redis backend (perhaps that is the default I had set somewhere). Regardless, it wasn't using the timeout parameter that the version_data was using thus making the cache effectively expire far before I wanted it to. Since I don't want to have to pass a timeout parameter into delete_memoized(), I also changed the behaviour to delete the cache regardless of whether there are function parameters or not.