web/views/basecontrollers.py
branchstable
changeset 9229 739ae5366bed
parent 8974 c8520188eb4b
child 9700 da7d341cca76
equal deleted inserted replaced
9228:90b8c7a7e205 9229:739ae5366bed
     1 # copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     1 # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 #
     3 #
     4 # This file is part of CubicWeb.
     4 # This file is part of CubicWeb.
     5 #
     5 #
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
   126 
   126 
   127     def publish(self, rset=None):
   127     def publish(self, rset=None):
   128         """publish a request, returning an encoded string"""
   128         """publish a request, returning an encoded string"""
   129         view, rset = self._select_view_and_rset(rset)
   129         view, rset = self._select_view_and_rset(rset)
   130         self.add_to_breadcrumbs(view)
   130         self.add_to_breadcrumbs(view)
   131         self.validate_cache(view)
   131         view.set_http_cache_headers()
       
   132         if self._cw.is_client_cache_valid():
       
   133             return ''
   132         template = self.appli.main_template_id(self._cw)
   134         template = self.appli.main_template_id(self._cw)
   133         return self._cw.vreg['views'].main_template(self._cw, template,
   135         return self._cw.vreg['views'].main_template(self._cw, template,
   134                                                     rset=rset, view=view)
   136                                                     rset=rset, view=view)
   135 
   137 
   136     def _select_view_and_rset(self, rset):
   138     def _select_view_and_rset(self, rset):