From 4de007a946f071ee851e91b26c17e18d50d68ee2 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Fri, 16 Oct 2015 21:39:30 -0500 Subject: [PATCH] fixed possible problem with cache.action --- gluon/cache.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/gluon/cache.py b/gluon/cache.py index ba3ea534..c2f9a488 100644 --- a/gluon/cache.py +++ b/gluon/cache.py @@ -606,22 +606,26 @@ class Cache(object): def wrapped_f(): if current.request.env.request_method != 'GET': return func() + + if quick: + session_ = True if 'S' in quick else False + vars_ = True if 'V' in quick else False + lang_ = True if 'L' in quick else False + user_agent_ = True if 'U' in quick else False + public_ = True if 'P' in quick else False + else: + (session_, vars_, lang_, user_agent_, public_) = \ + (session, vars, lang, user_agent, public) + if time_expire: cache_control = 'max-age=%(time_expire)s, s-maxage=%(time_expire)s' % dict(time_expire=time_expire) - if quick: - session_ = True if 'S' in quick else False - vars_ = True if 'V' in quick else False - lang_ = True if 'L' in quick else False - user_agent_ = True if 'U' in quick else False - public_ = True if 'P' in quick else False - else: - session_, vars_, lang_, user_agent_, public_ = session, vars, lang, user_agent, public if not session_ and public_: cache_control += ', public' expires = (current.request.utcnow + datetime.timedelta(seconds=time_expire)).strftime('%a, %d %b %Y %H:%M:%S GMT') else: cache_control += ', private' expires = 'Fri, 01 Jan 1990 00:00:00 GMT' + if cache_model: #figure out the correct cache key cache_key = [current.request.env.path_info, current.response.view]