- Info
Common elements to caching
A brief explanation about what we are going to set up.
Plone is a very complex system. Whereas a flat HTML
site might only take a hundredth of a second to load from a server, Plone's main page is fully
dynamically rendered for each and every request. This might mean it
takes up to 3 or 4 seconds to load a particularly expensive page if you have a slow server or and no caching.
Adding on top the fact that,
including javascript and css the page size exceeds 100KB and can take
more than 30 seconds to download, this can make for a pretty slow
experience. Obviously, if you've got more than a couple of users on
your site at once, it's going to be unusable.
That's the bad news.
However, it's not all bad. The Zope application which underlies
Plone was never meant to be a web server. Fortunately, we can use
Apache as a front-end web server to handle all of the tedious
connections from the web through a process called 'reverse
proxying'.
To setup a reverse proxy is pretty easy. First, configure your Zope
so that it's not running on port 80. By default, Zope runs on port 8080, but some installers and distributions use other ports - so substitute 8080 for whatever port your instance is running on. The important thing is that it should not be running on port 80, where we'll add the web server that should be in front of Plone.
Test this by accessing your site at 'http://yoursite.com:8080'.
For the proxying to work, you need to add a 'Virtual Host Monster' to the
root folder of your Zope installation. Call it anything you want, but
it *must* be added to the root of your Zope, and not the root
of your Plone site.
**Plone 2.0 only:** If you are running Plone 2.0.x, you will also need to edit the 'portal_skins/plone_templates/global_cache_settings'
template to prevent Plone from sending out a 'Pragma: no-cache'
HTTP header. By default, Plone was setup to disable all HTTP caching to ease
development.
Simply locate the template in your Plone site through the ZMI, and
customise it into your custom skin folder. Now, edit it so that the
contents are::
You are now ready to set up the web server.