Skip to content

Instantly share code, notes, and snippets.

@christianhanvey
Last active June 14, 2017 11:26
Show Gist options
  • Save christianhanvey/5318507 to your computer and use it in GitHub Desktop.
Save christianhanvey/5318507 to your computer and use it in GitHub Desktop.
Some links on caching for MODX

If you are using git, so you can take advantage of static elements within MODX, you will need to be aware that simply updating your files does not mean MODX will pick that up. It will pick up changes in a file IF you the element is being called uncached.

http://forums.modx.com/forums/thread/73346/static-resources-don-t-update-without-cache-clear http://forums.modx.com/thread/73002/static-sources-caching-and-setup

This is not a big deal while working on a development site, performance is not your initial priority at that point. But when you get to deploying, you'll need to know that updating a file will not necessarily update how your site runs, and you don't want to be clearing your entire site cache. A big site would be taking a heavy server hit as its visitors trigger all pages regenerating their cache...

For an overview of MODX caching strategy, start at the documentation (of course) if you havn't already:

http://rtfm.modx.com/display/revolution20/Caching

Explaining it for the masses:

https://www.markhamstra.com/modx-blog/2011/10/caching-guidelines-for-modx-revolution/

And more:

https://www.markhamstra.com/modx-blog/2011/11/nested-caching-in-modx-revolution/

Now, how to take advantage of caching:

http://www.sepiariver.ca/blog/modx-web/advanced-cache-management-to-turbocharge-your-modx-sites

More on using GetCache:

http://www.jasoncoward.com/technology/2010/10/simple-content-caching-with-getcache.html

A simple way to avoid the complete cache dump:

http://bobsguides.com/cachemaster-tutorial.html

Other caching strategies and related extras:

http://devries.jp/blog/2013/03/23/cash-in-big-with-modx-cacheing/

A deeper way to tackle granular caching:

http://modx.com/blog/2012/10/29/optimization-with-getcache-and-custom-cache-partitions/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment