tools.gzip and static files

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

tools.gzip and static files

Andrew Maizels

I'm using CherryPy behind Pound for my application, so I have no web
server except the built-in one.  Since my content is mostly dynamic
(even the images) this hasn't been an issue, except that static files
don't appear to get gzipped (while dynamic content is).

So my question is in two parts, I guess.  First, is this right, or
have I screwed up my configuration?  Second, if this is the right
behaviour, is there a straightforward workaround?  I can code
something up that checks the file type and turns it into dynamic (and
thus compressible) content when appropriate instead of just calling
serve_file, but if there's a flag I can set, obviously I'd rather do
that.

Thanks,

Pixy


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: tools.gzip and static files

Sylvain Hellegouarch

Trye adding this:

tools.gzip.mime_types= ['text/html', 'text/plain', 'image/jpeg',
'image/png']

- Sylvain

Pixy Misa a écrit :

> I'm using CherryPy behind Pound for my application, so I have no web
> server except the built-in one.  Since my content is mostly dynamic
> (even the images) this hasn't been an issue, except that static files
> don't appear to get gzipped (while dynamic content is).
>
> So my question is in two parts, I guess.  First, is this right, or
> have I screwed up my configuration?  Second, if this is the right
> behaviour, is there a straightforward workaround?  I can code
> something up that checks the file type and turns it into dynamic (and
> thus compressible) content when appropriate instead of just calling
> serve_file, but if there's a flag I can set, obviously I'd rather do
> that.
>
> Thanks,
>
> Pixy
>
>
> >  


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: tools.gzip and static files

Andrew Maizels

Beautiful!  I thought I'd seen something like that documented
somewhere, but I couldn't find it.

Works perfectly.

Thanks,

Pixy

On Aug 10, 2:25 am, Sylvain Hellegouarch <[hidden email]> wrote:
> Trye adding this:
>
> tools.gzip.mime_types= ['text/html', 'text/plain', 'image/jpeg',
> 'image/png']
>
> - Sylvain


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---