Mailing List Archive

Re: Question about compressing static files or serving pre-compressed static files
Hello Jon,

That one of the primarily uses of Front-Line Cache. Cherokee can compress a
response and store a copy for subsequent requests (it works pretty much in
the same way as an intermediate proxy-cache server). The following links
should introduce the topic:

- http://www.alobbs.com/1394/Front_Line_Cache_Configuration.html
- http://www.cherokee-project.com/doc/other_front_line_cache.html

Cheers!


On Tue, Aug 30, 2011 at 1:25 AM, Jon Strabala <jon.strabala@quantumsi.com>wrote:

> Hi,
>
> I use cherokee Version: 0.99.43, but try as I might I can not figure out
> how to determin the best way to server compressed *.css and *.js files.
>
> My files rarely change (once a month) and the biggest things I server are
> JavaScript followed by CSS files.
>
> *Method #1 - not that I know how to do it in Cherokee *
>
> Should I can pre-compress then with a gzip -9 "filename", if so how do I
> set up cherokee to serve them I know how to do it with Apache refer to an
> unanswered posting in the user-groups
> http://www.mail-archive.com/cherokee@lists.octality.com/msg03758.html
>
>
> In Apache I'm used to doing this to get Apache to send a pre-compressed
> js
>
> file when it's asked for javascript:
>
>
> RewriteCond %{HTTP:Accept-encoding} gzip
>
> RewriteCond %{HTTP_USER_AGENT} !Safari
>
> RewriteCond %{LA-U:REQUEST_FILENAME}.gz -f
>
> RewriteRule ^(.*)$ $1.gz [QSA,L]
>
>
> <files *.js.gz>
>
> ForceType text/javascript
>
> Header set Content-Encoding: x-gzip
>
> </files>
>
>
> This returns for *.js.gz when asked for *.js and sets the header
>
> appropriately if found. Is there a way to do effectively the same thing in
>
> Cherokee?
>
>
> I am left with the same question. Is it best to pre-compress and then
> somehow get Cherokee to serve compressed files EXCEPT to Safari user-agents.
>
>
> *Method #2 - not that I know how to do it in Cherokee*
> *
> *
>
> Somehow set up an encoder for my *.js and my *.css scripts. I read the
> following:
>
> "
> Whenever you set up a virtual server, creating a rule where gzip<http://www.cherokee-project.com/doc/modules_encoders_gzip.html> is
> enabled by default for the following file types: html, htm,txt, css and js is
> a good idea. You are encouraged to use this. Hardware is cheap. Bandwidth is
> not."
>
>
> So perhaps I want to be serving compressed *.js and my *.css scripts - I
> only have a Handler for "Static Content" and Encoding as follows:
>
> GZip Support "leave unset"
>
> Deflate Support "leave unset"
>
>
> If I set
>
> GZip Support "leave unset"
>
> I get compression BUT (at the client) but is it efficient (I don't want
> to compress 200K over and over again), intuitively it seems like if I know
> what I want to compressed I should compress it myself in the file system.
> Cherokee seems to want to compress it fromt he non-compressed file and then
> serve it.
>
> In the actually conf file the only difference is as follows:
>
> vserver!20!rule!100!encoder!gzip = allow
>
> As you probably can tell I am concerned about efficiency, what if I have so
> many *.css and *.js files that the can not be gzip'd and held in a Cherokee
> cache. I would appeciate you comments, a reference to a maillist positing
> or an update to one of the DOC pages - that explains gzip efficiency a) is
> it gzip'd once b) what is the cahce size to prevent re-gzip-ing c) how do
> you set a compression level ? and d) other ....
>
>
> http://www.cherokee-project.com/doc/config_virtual_servers_rule.html
> http://www.cherokee-project.com/doc/modules_encoders.html
> http://www.cherokee-project.com/doc/modules_encoders_gzip.html
>
>
>
>
> Best Regards,
>
> Jon Strabala, CTO
> Quantum Systems Integrators, Inc.
> 950 South Coast Drive, Suite 120
> Costa Mesa, CA 92626
>
> Jon.Strabala@QuantumSI.com
> http://www.QuantumSI.com <http://www.quantumsi.com/>
> phone 714 428 1133
> fax 714 428 1131
> mobile 714 240 3083
>
>


--
Greetings, alo.
http://www.alobbs.com/