Skip to content

Commit fff5cdc

Browse files
committed
Update README.rst
1 parent 494e949 commit fff5cdc

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

README.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,20 @@ Reference
195195
to ``DEFAULT_MOBILE_FLAVOUR`` settings value in case.
196196

197197
``django_mobile.cache.cache_page``
198-
Same as django's ``cache_page`` decorator but applies ``vary_on_flavour``
199-
before the view is decorated with
200-
``django.views.decorators.cache.cache_page``.
198+
Same as django's ``cache_page`` decorator, but wraps the view into
199+
additional decorators before and after that. Makes it possible to serve multiple
200+
flavours without getting into trouble with django's caching that doesn't
201+
know about flavours.
201202

202-
``django_mobile.cache.vary_on_flavour``
203-
A decorator created from the ``CacheFlavourMiddleware`` middleware.
203+
``django_mobile.cache.vary_on_flavour_fetch``
204+
``django_mobile.cache.vary_on_flavour_update``
205+
A decorators created from the ``FetchFromCacheFlavourMiddleware`` and ``UpdateCacheFlavourMiddleware`` middleware.
204206

205-
``django_mobile.cache.middleware.CacheFlavourMiddleware``
206-
Adds ``X-Flavour`` header to ``request.META`` in ``process_request`` and
207-
adds this header to ``response['Vary']`` in ``process_response``.
207+
``django_mobile.cache.middleware.FetchFromCacheFlavourMiddleware``
208+
Adds ``X-Flavour`` header to ``request.META`` in ``process_request``
209+
210+
``django_mobile.cache.middleware.UpdateCacheFlavourMiddleware``
211+
Adds ``X-Flavour`` header to ``response['Vary']`` in ``process_response`` so that Django's ``CacheMiddleware`` know that it should take into account the content of this header when looking up the cached content on next request to this URL.
208212

209213

210214
Customization

0 commit comments

Comments
 (0)