Commit 947080de 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 915ff413
...@@ -49,7 +49,6 @@ class OOoDocumentExtensibleTraversableMixin(BaseExtensibleTraversableMixin): ...@@ -49,7 +49,6 @@ class OOoDocumentExtensibleTraversableMixin(BaseExtensibleTraversableMixin):
web_cache_kw = {'name': name, web_cache_kw = {'name': name,
'format': EMBEDDED_FORMAT} 'format': EMBEDDED_FORMAT}
try: try:
self._convert(format='html')
view = _ViewEmulator().__of__(self) view = _ViewEmulator().__of__(self)
# call caching policy manager. # call caching policy manager.
_setCacheHeaders(view, web_cache_kw) _setCacheHeaders(view, web_cache_kw)
...@@ -57,6 +56,7 @@ class OOoDocumentExtensibleTraversableMixin(BaseExtensibleTraversableMixin): ...@@ -57,6 +56,7 @@ class OOoDocumentExtensibleTraversableMixin(BaseExtensibleTraversableMixin):
# no content # no content
if _checkConditionalGET(view, web_cache_kw): if _checkConditionalGET(view, web_cache_kw):
return '' return ''
self._convert(format='html')
mime, data = self.getConversion(format=EMBEDDED_FORMAT, filename=name) mime, data = self.getConversion(format=EMBEDDED_FORMAT, filename=name)
document = OFSFile(name, name, data, content_type=mime).__of__(self.aq_parent) document = OFSFile(name, name, data, content_type=mime).__of__(self.aq_parent)
except (NotConvertedError, ConversionError, KeyError): except (NotConvertedError, ConversionError, KeyError):
......
...@@ -255,7 +255,6 @@ class WebSection(Domain, DocumentExtensibleTraversableMixin): ...@@ -255,7 +255,6 @@ class WebSection(Domain, DocumentExtensibleTraversableMixin):
if custom_render_method_id is not None: if custom_render_method_id is not None:
if document is None: if document is None:
document = self document = self
result = getattr(document, custom_render_method_id)()
view = _ViewEmulator().__of__(self) view = _ViewEmulator().__of__(self)
# call caching policy manager. # call caching policy manager.
_setCacheHeaders(view, {}) _setCacheHeaders(view, {})
...@@ -263,6 +262,7 @@ class WebSection(Domain, DocumentExtensibleTraversableMixin): ...@@ -263,6 +262,7 @@ class WebSection(Domain, DocumentExtensibleTraversableMixin):
# no content # no content
if _checkConditionalGET(view, extra_context={}): if _checkConditionalGET(view, extra_context={}):
return '' return ''
result = getattr(document, custom_render_method_id)()
return result return result
elif document is not None: elif document is not None:
return document() return document()
......
...@@ -2551,7 +2551,6 @@ class Base( ...@@ -2551,7 +2551,6 @@ class Base(
security.declareProtected(Permissions.View, 'view') security.declareProtected(Permissions.View, 'view')
def view(self): def view(self):
"""Returns the default view even if index_html is overridden""" """Returns the default view even if index_html is overridden"""
result = self._renderDefaultView('view')
view = _ViewEmulator().__of__(self) view = _ViewEmulator().__of__(self)
# call caching policy manager. # call caching policy manager.
_setCacheHeaders(view, {}) _setCacheHeaders(view, {})
...@@ -2559,6 +2558,7 @@ class Base( ...@@ -2559,6 +2558,7 @@ class Base(
# no content # no content
if _checkConditionalGET(view, extra_context={}): if _checkConditionalGET(view, extra_context={}):
return '' return ''
result = self._renderDefaultView('view')
return result return result
# Default views - the default security in CMFCore # 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