We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37523
    • 141 Posts
    What are the advantages/disadvantages of using Static Resources?

    I am more interested in how this relates to snippets/chunks and plugins

    - by using a static resource does the site run faster due to not having to create many calls to the database
    - having static resources sitting outside the database as files on the server seems to me a bit of a security risk in terms of easily changed
    - I can see that they can more easily be updated without having to login to the manager

    Querying minds want to know.
      Glyn Szasz
      Sydney, Australia

      Happy to help (when can) and happy to learn

      If you are a Sydney based MODX developer would love to hear from you. Please contact me.
    • Static resources still use the database. The only difference is that the "Content" field is a path to a file.

      I have never used them as content, I've only used them to stream .pdf and other files for download.
        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
        • 3749
        • 24,544 Posts
        One advantage is that the files can be put under version control and can also be edited locally and uploaded with FTP from inside a good code editor.

        I would certainly not do this if the files would contain sensitive information.

        One big disadvantage for me, when working locally, is that it's easy to forget what you're doing and lose the content altogether.
          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
        • Indeed. It's primarily useful for groups using version control. For us little guys, not so much. StageCoach is a lot more fun.

          Now that I use RO.IDEs and cssSweet for my CSS, and have the xmanagerunzip package to add a "file unzip" feature to the File Manager, I seldom use FTP any more.
            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