When you edit the file externally, MODx has no way of knowing that it's been edited, so you would need to clear the cache to have the changes show. When saving templates and chunks in the Manager, the cache is automatically cleared (unless you uncheck that option).
-
- 24,544 Posts
I think you can just reload the page in the Manager too. One problem is that MODX elements don't have an editedon field, so MODX has no good way to tell which is newer, the file or the stuff in the DB.
Clearing the cache is a necessary evil with static resources/elements. The convenience factor however can outweigh the evil, and I have been known to use a low down and dirty way to quickly clear the cache without the extra step of clearing the popup. I sometimes open a dummy page, or rather a resource, that I can save over and over again quickly. It takes the menu clicking and pop up "ok" clicking out of the picture for clearing the cache, thus eliminating at least 3 clicks.
I'd much rather work in an external editor than in MODX. This hacky and dirty method clears the cache as needed when I'm working with a lot of static resources. And one other piece of the puzzle, the quick edit save button is far less buggy than the save button on an open resource (which isn't always highlighted). Shrug... do what works best for you.
discuss.answer
-
- 24,544 Posts
There is also this:
http://modx.com/extras/package/cacheclear which might, or might not, be faster. You can just reload a page with the snippet to clear the cache. It has the advantage (or disadvantage) of clearing parts of the cache that are not cleared when you save a resource or clear the cache manually in the Manager.
-
- 30 Posts
Hi Everyone,
I tried Dasltsch's option, and this doesn't work for me. However i did tried this option using old resources so i guess thats the difference, so if i'm correct Dasltsch's option only works for new resources? Batcher also didn't work for me, it kept on caching.
For me BobRay's option did the magic! Works like a charm! I just embedded his code into the resource it self, so it clears out cache everytime i load the page it self. I'm not sure this is the best way to do it, but for me it works out just fine.
Frogabog's option also works great, if your looking for an even easier way to clear the cache i would recommend his aswel. (Saves you the 'hassle' of installing BobRay's CacheClear. So in production environment this might be easier, but when developing i can strongly recommend CacheClear embedded into your resource)
However i'm very curious about Dasltsch's option aswel, for some reason it doesn't seem to work for me. Could you maybe confirm that it will only work for new resources?
Thanks everyone for participating in this discussion, the power of the community; i love it.
Cheers,
Nick
-
- 24,544 Posts
It's my understanding that cache_disabled has no effect at all and I can't find any use of it in the MODX code.
-
- 30 Posts
Thats my conclusion aswel, it doesn't affect the file cache at all. Thanks for pointing out CacheClear. Works like a charm!