MOC Varnish
Copyright © by Jan-Erik Revsbech <janerik@mocsystems.com>Published under the Open Content License available from http://www.opencontent.org/opl.shtml
Table Of Contents
- 1. EXT: MOC Varnish
- 1.1. Introduction
- What does it do?
- This extension provides TYPO3 changes to increase performance of TYPO3 websites using Varnish.
- Varnish is s front-end cache or web-accelerator, developed specifically for boosting performance. It is written by FreeBSD core-developer Paul Henning Kamp, and more information can be found at . This extension requires some specific setup of Varnish, and as such, requires some knowledge of what varnish is and how it works.
- The extensions provides several things:
- When you program the plugin, decide what is the Time-to-live of this particular plugin. A latest news-list might have a long cache (since TYPO3 clears the cache when new articles are created), but a “currently logged in users” might have a shorter time-to-live. A plugins showing latest Twitter updates, might have a ttl of 60 seconds. Even though we want it to be 100% dynamic, a 60 second delay is probably acceptable, especially if it saves your site the day you have 6000 simultaneous hits.
- 1.2. Installation and administration
- 1.3. Basically all configuration is done in the Extension manager, so you basically just have to install the extension.
- 1.4. To use automatic cache clearing, the extensions currently relies on RealURL path cache. So when a given uid is typo is cleared, the URL for that page is looked up int the RealURL pathcache. So RealURL pathcache this mus be enabled to work. We do have a solution for sites where realURL pathcache is not used. Contact for details.
- 1.5. Notice that currently, all Varnish cache is cleared when a “clear all cache” is issued in TYPO3. This means that if you use one Varnish cache for several sites, this will purge all cache! In newer versiones of Varnish (2.3 I think), its possible to PURGE only URL's matcing a given host. This only requires a simple change to the VCL configuration. See the example VCL esi-full.vcl.
- 1.6. Currently clearing of cache is done by calling the URL that you are currently logged into. If you log into typo3 on the cache PURGE request to varnish is done to this could later on be configurable.
- 1.7. You need to include the MOC Varnish static TypoScript template to have ESI working correctly.
- 1.8. Needless to say, you need to have Varnish up and running, either on the same machine, or on another machine.
- 1.9. Configuration
- 1.10. This extension has som simple configuration options when installing via Extension manager. Basically it allows to switch on of off different features, like ESI and automatic cache clearing.
- 1.11. allowing the editor to choose the cache time-to-live himself.
- 1.12. Read online
- 1.13. Tutorial
- 1.14. This section contains some examples and tutorials. The tutorial takes you through a rather simple, yet effective configuration of TYPO3 and Varnish.
- 1.15. The tutorial assumes that you already have Varnish set up and running, and that you have just a little experience with configuring Varnish using VCL. Please consult the sparse, yet pretty good Varnish manual.
- 1.16. I have run all the examples on standard MAC Ports packages, as well as standard Debian packages.
- 1.17. The extension allows you to set a default value for how many seconds a USER_INT should be cached. This is very effective for boosting a complete site, but you must take care, that not USER_INT creates content that is unique for each user, since content is cached across users.
- 1.18. Read online
- 1.19. VCL Examples
- 1.20. How does it work?
- 1.21. When a (or possible several) URL for a page is found, the webserver makes a PURGE request to the given URL. Currently we use the host the backend is running on for the request. So you need to be logged in to the backend on a URL that the server resolves to the Varnish host. We are currently working on a solution where the varnish URL can be specified in the extension manager.
- 1.22. Known problems
- 1.23. To-Do list
- 1.24. ChangeLog
- 1.1. Introduction
This document is related to version 1.2.0 of the extension moc_varnish.