All the major browsers support gzipped content, signalled by the HTTP request header "Accept-Encoding: gzip". Several toolkits support auto-gzipping dynamic content in this case (Catalyst::Plugin::Compress::Gzip, Apache::Compress and my own CGI::Compress::Gzip )
But what about static content (specifically
In my current Catalyst project, I added a step to gzip all of my
[% SET gz = !c.config.devsite && c.req.header('Accept-Encoding').search('gzip') ? '.gz' : '' %]
<link rel="stylesheet" href="[% c.uri_for( "/css/site.css${gz}" ) %]" type="text/css"/>
<script type="text/javascript" src="[% c.uri_for( "/js/prototype.js${gz}" ) %]"></script>
I deliberately turn it off on the dev site because I change those files without rebuilding the whole app.
On a related note, can someone recommend a JS squisher that has a nicer API than JavaScript::Minifier?
JavaScript squisher (Score:2)
I'm sorry I can only unrecommend JavaScript::Squish [cpan.org]. It produces non-working JS for very simple input.
These regexes worked for me:
Re: (Score:1)