CacheFu and Zope+Squid+Apache
Mit vielen dank bis Tom Lazar für seine Hilfe.
Once I figured out how to install and configure it properly, CacheFu together with Squid significantly improved the performance of my web site. Unfortunately, I had a tough time finding good documentation for either tool, as CacheFu's documentation is a work-in-progress and Squid 2.6's documentation is non-existent.
CacheFu's installation is simple enough: Untar in your Zope's Products directory and restart Zope. There's a Plone control panel that you should install using Add/Remove Products. Make certain to enable the ICP listener in zope.conf, as well.
Squid's installation isn't difficult either, as binaries exist for most major UNIX, BSD, and Linux distributions. If you are just running a single web server with Zope behind Apache, the following Squid configuration should suffice:
http_port 127.0.0.1:3128 defaultsite=127.0.0.1
cache_peer 127.0.0.1 parent 8080 8888 default connect-timeout=1800
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl all src 0.0.0.0/0.0.0.0
acl localhost src 127.0.0.1/32
http_access allow localhost
http_access deny all
acl purge method PURGE
http_access allow purge localhost
http_access deny purge
icp_access allow localhost
icp_access deny all
Everything's bound or restricted to the loopback interface in order to maintain operational security. This assumes that Zope listens on 8080/tcp for HTTP requests and on 8888/tcp for ICP requests. Note that instead of the old "httpd_accel_*" options, with Squid 2.6 you force connections to the Zope listener's address and service port in the "http_port" and "cache_peer" options. (Squid treats Zope like a parent cache in a cache mesh, allowing for moderately complicated load-balancing configurations where multiple Squid instances can cache content for multiple Zope instances, all referring back to the same Zope database via a clustered ZEO instance. It might even be possible to enable Squid's offline mode in this configuration, so that Squid could continue to serve content should the underlying Zope(s) become unavailable!)
The typical Apache front-end uses mod_rewrite and mod_proxy together with Zope's virtual host monster in a configuration that looks similar to the following:
RewriteRule ^/(.*) http://localhost:8080/VirtualHostBase/http/www.example.com:80/Plone/VirtualHostRoot/$1 [P]
Change the Zope service port (8080 above) to the Squid service port (3128) in order to route requests through the proxy-cache:
RewriteRule ^/(.*) http://localhost:3128/VirtualHostBase/http/www.example.com:80/Plone/VirtualHostRoot/$1 [P]
(I am hosting other web sites in addition to my primary Zope site, otherwise I would have replaced Apache with Squid.)
Complete the CacheFu installation by navigating to Plone's Site Setup page, then choosing Cache Configuration Tool. On this page, set the cache configuration to "Zope behind Squid behind Apache", enter all of possible public domain names of your web site (as directed), and the Squid URL ("http://127.0.0.1:3128" if using the above Squid configuration). CacheFu will begin caching Plone's default content types as soon as you click Save.
If you add additional types to your Plone instance, you'll need to configure CacheFu to handle them accordingly. Add folderish types to the Containers rule (Site Setup, Cache Configuration Tool, Rules, Containers). Some folderish types might include Weblog and WeblogArchive from Quills, or HelpCenter, HelpCenterReferenceManualFolder, HelpCenterReferenceManual, and HelpCenterReferenceManualSection to name a few from Plone Help Center. Add page-like content types to the Content rule (Site Setup, Cache Configuration Tool, Rules, Content). Some content types might include PloneExFile, WeblogEntry, or HelpCenterReferenceManualPage.
Trackback
The URI to TrackBack this entry is: http://web.irtnog.org/Members/xenophon/blog/archive/2007/06/11/cachefu-and-zopesquidapache/trackback-
Classic car:
Sport cars
Sport cars, classic cars, traveling and racing