Last change
on this file since 3628 was
3322,
checked in by fenix, 13 years ago
|
added compression for csshover.htc view.
|
-
Property svn:eol-style set to
native
|
File size:
841 bytes
|
Line | |
---|
1 | import os |
---|
2 | |
---|
3 | from Products.Five.browser import BrowserView |
---|
4 | |
---|
5 | |
---|
6 | class 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 | |
---|
22 | # enabling gzip compression |
---|
23 | response.enableHTTPCompression(REQUEST=self.request) |
---|
24 | return resource |
---|
Note: See
TracBrowser
for help on using the repository browser.