We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33657
    • 128 Posts
    What is the fastest way to work in ModX if you are using a outside editor and static resources.

    Do I need to run a local ModX with MAMP and build my database offline?

    Right now hitting the server with static resources. On Save - Upload. Then its a bunch of refreshes and the resource isn't changed. Do I have to clear cache everytime? I turned all cache off in modx system settings and it didn't seem to have any impact.
    • You shouldn't need to clear the cache after editing a file for a static resource. The only part of the resource that's cached is the path to the file (which is saved in the content field).
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 33657
        • 128 Posts
        Thats weird. because I am not getting anything to refresh. I even browsed in Private Mode with Cache Disabled. So my browser isn't caching files.

        Does this work for any static resource? because i made a chunk, put javascript in it.

        opened it up in a FTP and changed it via the static resource.

        save a JS file as a static resource with - alert("1");
        refresh.
        save the same JS file in a FTP or on a local computer and upload it. alert("2");

        page doesn't update. same alert.

        in fact, i can remember that a year or two ago when static resource first came out i had the same issue with them then that i have now. that they are slower than just alt tabbing into a browser and pasting in a file.

        Can anyone confirm this is suppose to be instant? is it a server setting? any suggestions?
          • 38525
          • 26 Posts
          Hi,

          Just posted here about my experiences with ElementHelper, really great plugin for this. Edit static resources without having to clear the cache all the time.

          But if you have problems with JS not updating, that could also be a problem with browser cache. I always disable it in the settings of the element inspector in Chrome, so when that's open it reloads JS and CSS on every refresh.

          My setup right now is to run MODX locally on MAMP for development, with static files. Sometimes when colleagues or clients want to work on the website too, I connect to a remote DB so they can update the content, and I will then update the static files through Git.
            • 33657
            • 128 Posts
            ok I read @suikerzout's post and I am back to what i was asking before. I was correct to say that the static resource won't change until the cache changes. meaning if you update a static file in a ftp, you can refresh all day, but until you open the manager and clear cache or navigate and save that file in the manager it won't update?

            Is there a way to update the cache from a command line? ssh or some other way so i don't have to log into modx to rebuild the cache?

            edit: got Mamp 3 going. downloaded my database from the web and can do it locally, and at first I was having the same problem of cache issues. but I created a static resource in modx's manager and it saved it as _www:wheel for chown, and that resource updates realtime with no cache changes... so i just did a chown on my assets folder and we'll see how it goes.

            edit -2: ElementHelper is nice. Thank you for that. I will be using it or something similar from now on. Can't see not using it. This was one of my big issues with creating tv's was how slow it was. with this I can hammer through a json file and update them super quick.

            Thanks! [ed. note: zurie last edited this post 9 years, 10 months ago.]
              • 10525
              • 247 Posts
              Any recent developments with static resources? I seem to be having a similar issue with a TV which uses a static file. Changing the file externally has no effect at the front end, even though the changes appear in the page's TV input.
                • 3749
                • 24,544 Posts
                Is the page cached? That sounds like a cache issue.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting