Question

So I've got the template files working correctly. Sort of.

enter image description here

The static resource does render. But when I make changes to the file, I MUST hit save in the Modx ui before the changes show up in the output. Is there any way I can turn the cache off all together? Or at-least have some kind of 'watch' system that refreshes the cache on file save? I would really like to start using modx, but so far the templating work flow is really painful.

There has got to be a package for this. But so far my googling has come up short.

Thanks SO!

Was it helpful?

Solution

You just need to turn off "cache_resource" in system settings. ( http://rtfm.modx.com/display/revolution20/cache_resource ) Do not forget the end of the development process to return the setting to its original position. You can make yourself a reminder directly in the file, for example: <!-- Partial Resource Cache is Off Now -->

OTHER TIPS

You can turn off the default cache in the system settings [or set the cache lifetime to 1 second, 0 isn't documented, but I thin it means 'forever' rather than 0 seconds] & that should work for you. [I've had the same issues - it does work]

Though you are going to want to store your templates in the DB for performance after you are done developing, taking advantage of database & query caching as well as disk cache.

AND you might want to look into using ACE or codeMirror packages rather than a remote editor. I do not believe there are any packages that can watch for changes on a file ~however~ you could also write a plugin to do this for you.

Actually, turning off the cache is silly and unnecessary.

Simply CLEAR THE CACHE in the site menu if and when you ever update the static template on the file system.

Also, as to the statement of storing the templates in the database for performance, simply ignore that. Performance will come from the page being cached whether from the DB or the filesystem.

The performance is in the cache, not to mention the utilization of minify and other techniques.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top