alexex/wiki — pull request #32 by mgaitan (2013-06-30 00:35:31+00:00)
Title: Very simple cache

This is a extremely simple cache system that leverage in [flask-cache](http://pythonhosted.org/Flask-Cache).
The approach is to cache the `display` view and delete that *page* cache after edition.

The only problem it has at the moment is the `flash()` "success" message. As the page is cached, this message will be shown in any further request to the `display` view for that page.

## Alternatives

- use `memoize` on a deeper function/method (for example on `Wiki.get_or_404`).
- add a query to the url like `/url/?success` and, via javascript, only show the message if that query is present
- instead of `@cache.cached` decorator, set a version without messages via `cache.set` inside the `display` view
- remove `flash()` call in `edit` before redirect.