Merge pull request #2103 from erbalito/patch-3

resolves #1729
This commit is contained in:
mdipierro
2019-03-02 23:04:38 -08:00
committed by GitHub
+6 -7
View File
@@ -600,15 +600,14 @@ class Cache(object):
(session_, vars_, lang_, user_agent_, public_) = \ (session_, vars_, lang_, user_agent_, public_) = \
(session, vars, lang, user_agent, public) (session, vars, lang, user_agent, public)
expires = 'Fri, 01 Jan 1990 00:00:00 GMT'
if time_expire: if time_expire:
cache_control = 'max-age=%(time_expire)s, s-maxage=%(time_expire)s' % dict(time_expire=time_expire) cache_control = 'max-age=%(time_expire)s, s-maxage=%(time_expire)s' % dict(time_expire=time_expire)
if not session_ and public_: expires = (current.request.utcnow + datetime.timedelta(seconds=time_expire)).strftime(
cache_control += ', public' '%a, %d %b %Y %H:%M:%S GMT')
expires = (current.request.utcnow + datetime.timedelta(seconds=time_expire) else:
).strftime('%a, %d %b %Y %H:%M:%S GMT') cache_control = 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0'
else: cache_control += ', public' if not session_ and public_ else ', private'
cache_control += ', private'
expires = 'Fri, 01 Jan 1990 00:00:00 GMT'
if cache_model: if cache_model:
# figure out the correct cache key # figure out the correct cache key