Views/SimpleCache

The SimpleCache is a mechanism designed to alleviate the need for certain views to be regenerated dynamically. Instead, they are generated once, saved as a static file, and served in a way that entirely bypasses the Elgg engine.

If SimpleCache is turned off (which can be done from the administration panel), these views will be served as normal, with the exception of site CSS.

The criteria for whether a view is suitable for the SimpleCache is as follows:

  • The view must not change depending on who or when it is being looked at
  • The view must not depend on variables fed to it (except for global variables like site URL that never change)

Contents

Regenerating the SimpleCache

You can regenerate the SimpleCache at any time by:

  • Loading /upgrade.php, even if you have nothing to upgrade
  • Enabling or disabling a plugin
  • Reordering your plugins

Using the SimpleCache in your plugins

Registering views with the SimpleCache

You can register a view with the SimpleCache with the following function at init-time:

elgg_register_simplecache_view($viewname);

Accessing the cached view

You can then access it at http://your-site/simplecache/view.php?view=viewname, with an optional &viewtype=viewtype parameter.

Search docs