-
- 247 Posts
I developing static snippets in external php files. Setting Disable Global Cache Options (cache_disabled) to Yes didn't stop caching, changes to snippet calls in resources didn't appear until I cleared the cache, and I even got a php error message in a cache file for one of my static snippets.
I eventually disabled every cache type in Settings, and changes seem to appear in the front end on a normal refresh, but there are still files appearing in the core/cache dir.
Anyone else finding that cache_disabled doesn't work?
-
- 40 Posts
Have you disabled partial caching of resources too?
-
- 247 Posts
Yes, I have disabled that. Everything is set to 'No' except for Disable Global Cache Options and Empty Cache default.
-
- 24,544 Posts
I seem to recall that totally disabling the cache has never worked well. I could be wrong.
IIRC, static elements are stored in both the DB and the files. I think MODX uses the DB version, so changes to the files only come into play when you load the snippet in the Manager and then save it, or possibly when you clear the cache. If I'm right, you'd see the old version used even if caching were successfully turned off. I could be wrong about this too -- I've never explicitly tested it.
-
- 247 Posts
Hmm, seems a bit flaky to me. I have never been very confident with the way MODX allows editing of a static resource from both the file itself and from within the manager. I have lost code before due to that by saving an open snippet after changes made directly to the file. The intuitive think to my mind would be use only the file, if that is what the UI implies you're doing. I do get changes to the files appearing in the front end even if I have not loaded (opened) the snippet in the manager.
-
- 24,544 Posts
I've also lost code and almost never use the static option.
Without loading the snippet in the Manager, it may still be updated if you clear the cache, or the snippet is called uncached. I've never tested it.
-
- 1,145 Posts
I utterly distrust the Static option myself using the Static option.
It should treat static (remote file) as an INCLUDE.
And therefore not provide a MODX-internal way of editing/saving/dirtying said element content field.
I have not only lost code, but my poor already withered wits.
TinymceWrapper: Complete back/frontend content solution.
Harden your MODX site by
passwording your three main folders:
core, manager, connectors and renaming your
assets (thank me later!)
5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
-
- 24,544 Posts
LOL. I quit using the static option when I completely lost three hours of work on a very difficult coding problem. It works fine if you never have a momentary lapse, but if you program a lot, there are certain actions (like saving) that you often do without thinking.