Search squid archive

Re: new website: final beta

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux