Composr Tutorial: Cleanup tools

Written by Chris Graham (ocProducts)
The website cleanup tools page will allow you to empty any website cache, as well as automatically locate and repair common problems, and remove any orphaned data. There are a number of cleanup tools, which are run individually; ideally none ever need to be used, but if things happen outside the norm (such as corruption, or bugs), they can be very useful.

The tools are divided into "De-cachers" and "Optimisers" (which don't all strictly involve optimising, some are for general other kinds of maintenance task).


Caches / De-cachers

Image

Disabling caches

Disabling caches

(Click to enlarge)

For performance reasons, Composr defines a number of caches. During normal operation of Composr, these caches should be unnoticeable; if things are being edited from outside Composr theoretically Composr will automatically pick up on it, but you may sometimes need to force a cache flush.

On a default install all recommended caches are enabled.

Some kinds of cache may be turned off in the configuration, but leaving them on gives vastly improved performance.

If you can identify a situation where you need to rebuild or empty a cache that should not exist, please report it as a bug.

Self-learning cache

The self-learning cache is quite a sophisticated cache mechanism to speed up Composr. It learns what resources are used by a page, and then bulk-loads them in the future.

The self-learning cache is most relevant when it comes to language strings. To avoid having to load up all the language files a page might use (language files are relatively monolithic, so inefficient to load), it will remember what strings are used by a page. Pages may use different strings when executed in different contexts, so the cache will always fall-back to loading the full language files if it has to, with those strings then also being added to the cache for the future. However, what if a page is referencing a string that does not exist? The self-learning cache would always be loading the full language files to try and hunt for it. This is why the cache also learns what strings are used by a page but do not actually exist even in the full language files. A ramification of this is that if you are developing and add the strings later, you will need to clear out the self-learning cache for Composr to be able to pick up on the new strings. Further, if you referenced language strings at any point while forgetting to first do a language file include, the self-learning cache will just figure these strings don't exist anywhere, even if you add the include later.

Optimisers (advanced)

Image

The cleanup tools screen

The cleanup tools screen

(Click to enlarge)

There are a number of optimisers:
  • Correct MySQL schema issues – this is intended for programmers-only, you are very unlikely to need it.
  • Optimise/fix database tables – this will try and fix some database tables and works with MySQL-only. If the database has become very corrupt, you may need to use a tool such as phpMyAdmin to repair a database from outside Composr.
  • Broken URLs – this will look for broken URLs.
  • Regenerate image thumbnails – this will regenerate all thumbnails (slow and probably not useful).
  • Find orphaned uploads – find on-disk uploads that seem to no longer be referenced.
  • Delete page access statistics – remove old page statistics to reduce database usage.

Frankly most of these optimisers are not useful. We provide them for very rare situations, or for helping programmers manage complicated operations.

Concepts

Cache
A data store that contains precalculated results such that those results do not need to be calculated more than once; caches are designed to increase efficiency

See also


Feedback

Please rate this tutorial:

Have a suggestion? Report an issue on the tracker.

Back to Top