Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#612 closed enhancement (fixed)

[patch] decorator for managing cache-control header

Reported by: hugo Owned by: Jacob
Component: Core (Cache system) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by hugo)

The attached patch is a decorator that allows management of the Cache-Control header for django views. The idea is to tag all views that contain sensible data with:

@cache_control(private=True)
def private_view(request):
   ....

That way a Cache-Control: private header will be generated. This decorator merges the cache-control value with already set values and the patch changes the caching utilities to use this merging technique, too.

I patched the documentation to contain a short chapter on the cache_control decorator, too.

Attachments (1)

cache-control.diff (5.2 KB ) - added by hugo 19 years ago.
Cache-Control managing decorator and function

Download all attachments as: .zip

Change History (3)

comment:1 by hugo, 19 years ago

Description: modified (diff)

by hugo, 19 years ago

Attachment: cache-control.diff added

Cache-Control managing decorator and function

comment:2 by Jacob, 19 years ago

Resolution: fixed
Status: newclosed

(In [1020]) Fixed #612 - added cache control headers (thanks, hugo)

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