Part 0: Introduction
Part 1: Write and Test the PHP Script
Part 2: Create the Snippet
Part 3 – MODx API, Placeholders, Chunks
In the fourth part of this brief series on creating a custom MODx Evolution snippet, we’re going to do some optimizing to make our snippet a little more efficient. So far the snippet seems to be working as expected and is pulling in the feeds as needed. However, it’s a little inefficient. The way things are set up now, every time someone refreshes the page, the script fetches a new copy of the rss feed from the coding pad, or whatever source you’re pulling your feeds from. If you have a heavily trafficked site where people spend a lot of time on your site and visit many pages (thus, for example, constantly refreshing your snippet call in the sidebar), this can be resource heavy on both your side slowing your website down, and also on the web server that you’re pulling the feeds from. We can mitigate this by implementing caching.
Continue reading “MODx Evolution: Creating a Simple Custom Snippet Part 4 – Optimize with Caching”