• HEX: #626262
  • RGB: rgb(98, 98, 98)
  • HEX: #bfbfbf
  • RGB: rgb(191, 191, 191)
  • HEX: #e5e5e5
  • RGB: rgb(229, 229, 229)
  • HEX: #d4d4d4
  • RGB: rgb(212, 212, 212)
  • HEX: #a4a4a4
  • RGB: rgb(164, 164, 164)

Change MODx Resources to Cacheable In Bulk

Whenever I edit a MODx page I usually find myself making it uncacheable so that I can temporarily make quick updates and see the page in its new form upon each refresh. The problem is that I sometimes forget to make the page cacheable again when I’m done editing.

If you are careless like me then the following snippet might be useful for changing your MODx resources to cacheable in bulk. To do this simply specify the ultimate parent of the resources you would like to cache, the depth to go when collecting the resources to cache, and the sort order.


Subscribe for More!


I send out a monthly newsletter on various topics.

Take a moment to enter your details, and you can select the news you would like to have delivered to your inbox!