[Zope] Question on Zope and including generated HTML content

Dylan Reinhardt zope@dylanreinhardt.com
19 Jun 2003 21:22:38 -0700


On Thu, 2003-06-19 at 20:27, Sean O'Neill wrote:
> I basically have a directory called /usr/local/www/orca (and some other 
> areas) whose HTML content is automagically regenerated every 5 minutes.
> 
> Basically, I'm hoping Zope can feed up this content up but I don't know how 
> to "include" this content in my Zope workspace.  I'm hoping this content 
> doesn't have to be "pulled" into Zope.  Just hoping Zope will simply push 
> the content out when requested.

There are three basic ways you could go about this.  

One common option is to keep your other content exactly as it is and use
Apache as a reverse proxy for both systems.  This is generally the best
option for fully dynamic external content, such as a squirrelmail
installation.  It's pretty easy to set up Apache to use more than one
source and switch among various sources based on URL matching.  Look at
the Apache docs for RewriteRule for details.

Another solution may be to port your dynamic content to Zope.  Without
knowing anything about this dynamic content, it's hard to know whether
that would be difficult or violate some other requirement.  But Zope is
excellent at hosting dynamic content... it's quite possible that it may
be applicable to your purpose.

The last solution I'll suggest is that you can cook up an external
method that renders/calls/reads the external source.  If that content is
a shell script or a file that some other process dumps out occasionally,
this may be just the trick.  External methods have the full range of
Python's abilities and can pretty much do anything, provided you have
sufficient privileges.  You could build a poor man's reverse proxy this
way if you really needed to.

If you use an external method and your external content only changes at
predictable intervals, you may see some significant benefit from caching
your results.  Zope has some built-in caching ability and there are any
number of other caching solutions.

Hope something in there helps.  There's more than one way to do it,
certainly... which method is best for you will depend on the specifics.

Dylan