[Zope] Re: Updating Caches

James Cammarata jimi at sngx.net
Mon Jun 7 17:35:59 EDT 2004


(mistakenly sent this to the poster, re-sending it here)

using a Cron / Windows Scheduler job it would be trivial to write a script 
using the Python HTTP module to make periodic requests to your web server 
from the proxy server.
do something like this:

#------------------
import httplib
conn = httplib.HTTPConnection("your proxy server address here")
requestpagelist = ('index.html',....) # all the pages you want cached
for page in requestpagelist:
    conn.request("GET", page)
    res = conn.getresponse()
    # do any other processing on the response here
conn.close()
#------------------

This is basically a 2 second hack of the example code from python.org for 
the httplib module.  Setup a scheduled job (Cron for linux, Scheduler for 
Windows) and your pages will periodically be grabbed and cached.
James Cammarata
jimi at sngx.net
www.sngx.net
home: 314-966-5976
work: 314-872-2426
cell: 314-409-0583
______________________________________________________________
Out the Ethernet, through the router,
down the fiber, off another router,
down the T1, past the fire-wall
...nothing but Net




More information about the Zope mailing list