Ariadne supports an advanced caching mechanism, consisting of several parts:
The private cache is used in templates, when designing a site. The private can contain often used building blocks for pages. It is called private, because the cache is only accessed after all user grants are checked and only via special functions embedded in templates. A private cache entry can only be used by the object and template that created it.
The time a private cache entry remains 'fresh' is controlled entirely by the template that created it. Changing the cache configuration in the Ariadne explorer environment has no effect on the private cache. See the
cached() method in the programmers reference for more information on using the private cache in your own templates.
A system administrator, or editor has only one way to control the private cache: the private cache is cleared when the 'Clear Cache Now' checkbox is checked in the cache configuration screen.
The primary cache mechanism is the public cache. This cache mechanism captures the output of an entire request (the full page) and stores it on disk. The next request for the same page is handled by the loader, it returns the page as stored on disk and does not access the database at all.
This caching system is very fast, but limited to public pages only. When another user, not public, is browsing through a site, the system won't generate new cached pages. The loader will still display cached versions of pages.
This caching mechanism is off by default. You can turn it on from the cache menu: settings -> caching. The options are:
Inherit Cache Config.
This is the default value, it simply uses the cache configuration as set in its parents.
Refresh cache on Request.
Each time a page is requested, the system checks whether a cache image is available, and if it is still fresh. The time an image is considered 'fresh' can be entered in the text box.
Refresh cache on Change.
Currently this simply sets the cache freshness time out to 999 hours, the maximum. In future versions of Ariadne, this will keep the cache image fresh unlimited. Upon a change in the object, the cache image will be cleared.
Do not cache.
This disables the public cache, starting at the current object and below.
Refresh cache now!
This is a checkbox, which if set when you press Save, instructs Ariadne to clear the public and private cache recursively starting at the current object.
The cache is cleared automatically upon some user actions:
- Shift-reload in FireFox.
FireFox sends a header to indicate the user requests a fresh version of the page. Ariadne will clear the cache image of the current object and build a new page. Microsoft Internet Explorer does not send any indication to the server when a user presses shift-reload.
- Saving an object.
This clears the public and private cache for that object. It doesn't clear the cache for parent or children objects which may contain elements of the current object that may have changed. In this case clear the cache manually at the appropriate places.
- Changing grants.
This clears the public cache recursively, since the page may no longer be publicly available. The private cache is not changed.
- Changing templates or language settings.
This clears the public cache recursively, since the layout and content of pages may have changed. It doesn't clear the private cache. If a template, cached with the private cache, has changed, you will need to clear the cache manually.
- Changing the priority.
This doesn't clear public or private cache. You will have to clear the cache in the parent object manually.
When a page is publically cacheable, Ariadne will automatically send a client side cache header and expire time with the respons. This instructs the browser to cache the result on the browsers harddisk and use that, untill the expire time has passed.
Microsofts Internet Explorer can be configured to check if a local cache is still valid on each request. Ariadne handles these requests by checking if there is a local cache image and if it is still fresh.
If it is, Ariadne will simply return a header telling the browser to use the local version. The page is not generated again, but more importantly, not even the server side cached page is sent to the browser. Just a single header.
If the cache is no longer fresh, the requests is parsed as a normal page request and the result sent to the browser.