Code

Ticket #5047: patch_cache_control.patch

File patch_cache_control.patch, 672 bytes (added by permon, 7 years ago)

previous patch in patch format

Line 
1diff -r django/django/utils/cache.py djangonew/django/utils/cache.py
230c30
3< def patch_cache_control(response, **kwargs):
4---
5> def patch_cache_control(response, rewrite = True, **kwargs):
634a35,37
7>     * If rewrite set to False, then value 'max-age' in current Cache-Control
8>       header remains untouched, otherwise it could be rewritten by value from
9>       kwargs
1059a63,66
11>
12>     if not rewrite and 'max-age' in cc and 'max_age' in kwargs:
13>         del kwargs['max_age']
14>
1587c94
16<     patch_cache_control(response, max_age=cache_timeout)
17---
18>     patch_cache_control(response, rewrite = False, max_age=cache_timeout)
19Pouze v django: patch_cache_controll.diff