Opened 8 years ago

Closed 8 years ago

#5284 closed (fixed)

never_cache decorator is not documented

Reported by: Ville Säävuori <ville@…> Owned by: xbito
Component: Documentation Version: master
Severity: Keywords: cache, never_cache, sprintsept14
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

While searching docs for how to disable caching, I found that never_cache decorator in django.views.decorators.cache is not documented. It is, however, documented in changeset #2602.

Attachments (2)

never_cache_doc.diff (764 bytes) - added by xbito 8 years ago.
Patch for documentation.
never_cache_doc.2.diff (766 bytes) - added by xbito 8 years ago.
Respect the line width.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 8 years ago by Simon G. <dev@…>

  • Needs documentation set
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Want to write it up?

comment:2 Changed 8 years ago by Ville Säävuori <ville@…>

I was trying to say that the decoratos _has already been documented_ in changeset 2602 (the link above goes to bug 2602, not changeset) but for some reason it's not there anymore.

A quick copypaste and reformatting resulted in:

If you want to use headers to disable caching altogether, ``django.views.decorators.never_cache`` is a view decorator that adds
headers to ensure the response won't be cached by browsers or other caches. Example::

    from django.views.decorators.cache import never_cache
    @never_cache
    def myview(request):
        ...

Above should go under the heading "Controlling cache: Using other headers".

Changed 8 years ago by xbito

Patch for documentation.

comment:3 Changed 8 years ago by xbito

  • Has patch set
  • Needs documentation unset
  • Owner changed from nobody to xbito
  • Status changed from new to assigned

comment:4 Changed 8 years ago by xbito

  • Keywords sprintsept14 added

comment:5 Changed 8 years ago by Simon G. <dev@…>

  • Triage Stage changed from Accepted to Ready for checkin

comment:6 Changed 8 years ago by Uninen

I think the included hasn't got proper line length. It shoud be easy to correct after applying the patch, though.

Changed 8 years ago by xbito

Respect the line width.

comment:7 Changed 8 years ago by xbito

I have attached a new diff that respects the line length.

comment:8 Changed 8 years ago by adrian

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [6308]) Fixed #5284 -- Documented never_cache decorator. Thanks, xbito

Note: See TracTickets for help on using tickets.
Back to Top