Re: [squid-users] new website: final beta

From: Craig Skinner <craig.skinner@dont-contact.us>
Date: Wed, 9 May 2007 14:46:14 +0100

On Wed, May 09, 2007 at 02:14:33PM +0200, Ralf Hildebrandt wrote:
> >
> > Nice work Adrian!
>
> Definitely.
>

Struth Bruce! Nice one mate!

Sort of quoting one of Yahweh's olde proverbs:
"...squidmaster, cache thy self"

Will the final site be cache-able?

I don't have the web skills that you do, but I found the easiest way to
make php's cache-able was to lynx dump the php to a .html, and have
apache serve index.html in preference to index.phtml. Naturally, all
links to pages must be to the .html and not the .php:

$ cat /usr/local/site/bin/php2html
#!/bin/ksh

# the packet filter prevents local access to the public interfaces
export http_proxy='http://localhost:80/'

host=$1
host ${host} > /dev/null
[ $? -ne 0 ] && { host ${host}; exit 1; }

shift

for source in $*
do
        #echo ${source} | grep '.phtml$' || continue
        html=$(echo ${source} | sed 's~.phtml$~.html~')
        lynx -source ${host}/${source} > ${html}~
        mv ${html}~ ${html}
done

I then build a file of phps to redirect into the above via find, grep &
friends, to exclude items that need to be dynamic, such as contact forms
and the like. I supose you could be more intelligent and only process
the phps that are newer than the (non-existing?) corresponding static
page:

$ head php2html.list
404.phtml yes, apache is set to 404 on the static .html
index.phtml
faq/*.phtml
pricing/index.phtml
pricing/resellers.phtml
..
..

-- 
Craig Skinner | http://www.kepax.co.uk | aye-right@kepax.co.uk
Received on Wed May 09 2007 - 07:46:22 MDT

This archive was generated by hypermail pre-2.1.9 : Fri Jun 01 2007 - 12:00:04 MDT