Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@ The cached decorator has another optional argument called ``unless``. This
argument accepts a callable that returns True or False. If ``unless`` returns
``True`` then it will bypass the caching mechanism entirely.

.. warning::

When using ``cached`` on a view, take care to put it between Flask's
``@route`` decorator and your function definition. Example::

@app.route('/')
@cache.cached(timeout=50)
def index():
return 'Cached for 50s'

If you reverse both decorator, what will be cached is the result of
``@route`` decorator, and not the result of your view function.

Caching Other Functions
-----------------------

Expand Down