Is gzip compression possible when using <plone:static?

Hi all

My css and js files served as part of my diazo theme have no gzip compression applied to them. I've looked into it a bit more and noticed that and assets served via <plone:static in the ZCML can not be served via GZIP compression.

I've added these two rules into my configure.zcml:

<plone:static directory="diazo_resources" type="theme"  />
<browser:resourceDirectory name="site.plonetheme" directory="diazo_resources" />

As you can see from this output below, the content served via the <browser:resource directive has gzip compression applied to it. Is there a way I can use gzip compression on the <plone:static call?

neil@neilf:~$ curl -X GET -I -H 'Accept-Encoding: gzip,deflate' http://0.0.0.0:8080/site/++resource++site.plonetheme/static/stylesheets/styles.css
HTTP/1.1 200 OK
Server: Zope/(2.13.22, python 2.7.6, linux2) ZServer/1.1
Date: Wed, 07 Oct 2015 06:05:57 GMT
Content-Length: 33174
X-Cache-Operation: plone.app.caching.strongCaching
Content-Encoding: gzip
Expires: Thu, 08 Oct 2015 06:05:57 GMT
Vary: Accept-Encoding
Cache-Control: max-age=86400, proxy-revalidate, public
X-Cache-Rule: plone.resource
Content-Type: text/css; charset=utf-8

.

neil@neilf:~$ curl -X GET -I -H 'Accept-Encoding: gzip,deflate' http://0.0.0.0:8080/site/++theme++site.plonetheme/++theme++site.plonetheme/static/stylesheets/styles.css
HTTP/1.1 200 OK
Server: Zope/(2.13.22, python 2.7.6, linux2) ZServer/1.1
Date: Wed, 07 Oct 2015 06:06:07 GMT
Content-Length: 243506
X-Cache-Operation: plone.app.caching.strongCaching
Expires: Thu, 08 Oct 2015 06:06:07 GMT
Cache-Control: max-age=86400, proxy-revalidate, public
X-Cache-Rule: plone.resource
Content-Type: text/css

I am using Plone 4.3.

Thankyou.

It's best to set up gzip compression using a frontend webserver like apache or nginx that proxies to Plone as a backend.

That is what I've ended up doing. Thankyou.

I just wanted to add that there is a very good reason to do it this way. Zope threads are precious due to their connection to expensive memory allocation. Gzipping in one of the reverse proxies allows us to make better use of processor cores.