Commit 78efce8e authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

Base, WebSection, OOoDocumentExtensibleTraversableMixin: do not compute the...

Base, WebSection, OOoDocumentExtensibleTraversableMixin: do not compute the response body in 304 Not Modified response case.
parent febc3d23
......@@ -49,7 +49,6 @@ class OOoDocumentExtensibleTraversableMixin(BaseExtensibleTraversableMixin):
web_cache_kw = {'name': name,
'format': EMBEDDED_FORMAT}
try:
self._convert(format='html')
view = _ViewEmulator().__of__(self)
# call caching policy manager.
_setCacheHeaders(view, web_cache_kw)
......@@ -57,6 +56,7 @@ class OOoDocumentExtensibleTraversableMixin(BaseExtensibleTraversableMixin):
# no content
if _checkConditionalGET(view, web_cache_kw):
return ''
self._convert(format='html')
mime, data = self.getConversion(format=EMBEDDED_FORMAT, filename=name)
document = OFSFile(name, name, data, content_type=mime).__of__(self.aq_parent)
except (NotConvertedError, ConversionError, KeyError):
......
......@@ -252,7 +252,6 @@ class WebSection(Domain, DocumentExtensibleTraversableMixin):
if custom_render_method_id is not None:
if document is None:
document = self
result = getattr(document, custom_render_method_id)()
view = _ViewEmulator().__of__(self)
# call caching policy manager.
_setCacheHeaders(view, {})
......@@ -260,6 +259,7 @@ class WebSection(Domain, DocumentExtensibleTraversableMixin):
# no content
if _checkConditionalGET(view, extra_context={}):
return ''
result = getattr(document, custom_render_method_id)()
return result
elif document is not None:
return document()
......
......@@ -2516,7 +2516,6 @@ class Base(
security.declareProtected(Permissions.View, 'view')
def view(self):
"""Returns the default view even if index_html is overridden"""
result = self._renderDefaultView('view')
view = _ViewEmulator().__of__(self)
# call caching policy manager.
_setCacheHeaders(view, {})
......@@ -2524,6 +2523,7 @@ class Base(
# no content
if _checkConditionalGET(view, extra_context={}):
return ''
result = self._renderDefaultView('view')
return result
# Default views - the default security in CMFCore
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment