Current Record: _output_cache #45

Note: There was a bug in the output cache affecting Xataface version 1.0 to 1.3rc1. If you are using a version of Xataface older than 1.3rc...

Current Record: _output_cache #45

Note: There was a bug in the output cache affecting Xataface version 1.0 to 1.3rc1. If you are using a version of Xataface older than 1.3rc...

The Xataface Output Cache

[Permalink]

Note: There was a bug in the output cache affecting Xataface version 1.0 to 1.3rc1. If you are using a version of Xataface older than 1.3rc2 then you should either disable the output cache, or replace the Dataface/OutputCache.php file with one from a newer version.

Xataface does quite a bit of heavy lifting on each page request. If your application is getting a lot of traffic that is slowing your server down, you may want to look at enabling the Xataface output cache.

Features

  • Improve speed of application dramatically - especially for seldom updated sites.
  • Supports multiple languages.
  • Supports multiple users (each user has own cache).
  • Provides GZIP compression for improved performance.

How it works?

When you receive a request, Xataface will return a cached version of the page if the page has been accessed before. If the page doesn't yet exist in the cache it generates the page, saves it to the cache and outputs it to the user transparently. The cache is completely transparent to your users.

Where is the cache stored?

Xataface creates a table called __output_cache that stores all of the cached content for your application. This table stores both a GZIPed and regular version of each page. If the user's browser supports GZIP compression, Xataface will automatically return the GZIP version. This results in further performance improvements.

What if I make changes to the database?

Xataface records which tables were in use when a page is cached. If any of those tables are modified after the page is cached, Xataface will mark that cached page as out of date and regenerate it the next time that it is requested.

What if I make changes to my configuration files and templates?

The output cache will have to be manually cleared if you make any changes to your source files (e.g. PHP, templates, and INI files). Clearing the cache is as easy as deleting or emptying the __output_cache table.

How do I enable the Cache?

Add the following to your conf.ini file:

[_output_cache]
    enabled=1

How do I disable the Cache?

Simply comment out or remove the [_output_cache] section of your conf.ini file. E.g.

;[_output_cache]
;   enabled=1

Configuration Options

The following directives can be added to the [_output_cache] section of your conf.ini file to customize how your output cache works.

Name Description Version
lifeTime Number of seconds before cached page is considered out of date. 0.7
tableName The name of the table to store the cached pages. Default '__output_cache'. 0.7
ignoredTables A comma-delimited list of tables that don't affect the output cache (i.e. these tables can be changed without causing the output cache to be refreshed. 0.7
observedTables A comma-delimited list of tables that should affect the status of the output cache for every page (whether the table is explicitly used by the page or not). This is a useful way to tell Xataface to refresh your cache. 0.7
exemptActions A comma-delimited list of actions that are exempt from the output cache (and thus should not be cached). 0.7
blog comments powered by Disqus
Powered by Xataface
(c) 2005-2024 All rights reserved