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)
expires = 'Fri, 01 Jan 1990 00:00:00 GMT'
if time_expire:
cache_control = 'max-age=%(time_expire)s, s-maxage=%(time_expire)s' % dict(time_expire=time_expire)
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'
expires = (current.request.utcnow + datetime.timedelta(seconds=time_expire)).strftime(
'%a, %d %b %Y %H:%M:%S GMT')
else:
cache_control = 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0'
cache_control += ', public' if not session_ and public_ else ', private'
if cache_model:
# figure out the correct cache key