/[sysadmin-cookbook]/recepies/apache2/deflate-test.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /recepies/apache2/deflate-test.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 155 - (show annotations)
Mon Nov 2 15:40:23 2009 UTC (14 years, 6 months ago) by dpavlin
File MIME type: application/x-sh
File size: 467 byte(s)
check if deflate gets any benefits to single URL

1 #!/bin/sh
2
3 if [ -z "$1" ] ; then
4 echo "Usage: $0 http://www.example.com/"
5 exit 1
6 else
7 url=$1
8 fi
9
10 time wget $url -O /tmp/foo
11 echo
12 time wget --header="Accept-Encoding: gzip" $url -O /tmp/foo.gz
13 echo
14
15 orig_size=`ls -al /tmp/foo | awk '{ print $5 }'`
16 comp_size=`ls -al /tmp/foo.gz | awk '{ print $5 }'`
17
18 if [ $comp_size -lt $orig_size ] ; then
19 echo "OK $comp_size < $orig_size";
20 else
21 echo "ERROR: no visible compression benefits"
22 fi
23
24 #ls -al /tmp/foo /tmp/foo.gz

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26