source: products/quintagroup.dropdownmenu/trunk/quintagroup/dropdownmenu/browser/css.py @ 3287

Last change on this file since 3287 was 3287, checked in by fenix, 13 years ago

added cache header for csshover.htc view to allow proxy and browser to cache it

  • Property svn:eol-style set to native
File size: 743 bytes
Line 
1import os
2
3from Products.Five.browser import BrowserView
4
5
6class CSSHoverView(BrowserView):
7    """Return csshover.htc js for IE < 7, this requires python class only
8    because of need to set custom content type for that resource.
9    """
10
11    def __call__(self):
12        """Main method"""
13        resource = file(os.path.join(os.path.dirname(__file__),
14                                     'resources', 'csshover.htc'), 'r').read()
15        response = self.request.response
16        response.setHeader('Content-Type', 'text/x-component')
17
18        # cache in browser for 1 year and in proxy for 2 month
19        response.setHeader('Cache-Control',
20                           'max-age=31536000, s-maxage=5184000, public')
21        return resource
Note: See TracBrowser for help on using the repository browser.