Blog Sections Open
Using Memcached to Speed Up Data-Heavy MODX Projects
A practical introduction to Memcached for older MODX and Evolution CMS installations that need faster object and page-level caching.
When a project starts to outgrow file-based caching, the next useful step is often not a redesign. It is better cache storage. This older article introduced Memcached as a way to keep associative data in memory and reduce repeated work inside PHP.
Basic installation
Ubuntu: sudo apt-get install memcached
Gentoo: sudo emerge install memcached
RedHat: sudo yum install memcached
sudo pecl install memcache
Once installed, the service can be started with a dedicated memory limit, IP, and port:
memcached -d -m 1024 -l 10.0.0.1 -p 11211
Using it from PHP
The original note extended an xPDO-based class and connected the cache manager to Memcached directly:
class MyXPDO extends xPDO
{
function __construct($dsn, $username = '', $password = '', $tablePrefix = '', $driverOptions = null)
{
parent::__construct($dsn, $username, $password, $tablePrefix, $driverOptions);
$this->config = array_merge(array('cache_db_handler' => 'Memcache'), $this->config);
if ($cacheManager = $this->getCacheManager()) {
$cacheManager->objcache->connect('10.0.0.1', 11211);
}
}
}
Why this mattered
On busier projects the gain was not theoretical. Cached objects, prebuilt blocks, and repeated query results all became cheaper to serve. The original article also pointed out the next real-world question: object caching is useful, but busy news or article projects also need a strategy for page fragments and invalidation.
That is still the important lesson. Better caching is not just about speed. It is about deciding what to cache, where to cache it, and when to refresh it.
Caching News Blocks for High-Load Evolution CMS Projects
A practical caching strategy for news-heavy sites where article lists should refresh only when content changes, not on every request.
Extending getResources tvFilters with Additional Comparison Operators
A practical parser-level tweak for older getResources setups that need richer TV comparisons such as <>, <=, and >= inside tvFilters.