We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5078
    • 3 Posts
    Hi everyone smiley

    This may seem like a silly question, but the size of web pages seems to be a very important topic when it comes to search engines and how they cache documents.

    If so, how can I ensure that the pages I create with MODx are below a 100K cap? For example:

    Counting the included javascripts, a graphic for the background (40Kb), and some basic text, my home page is 239Kb large according to Firefox.

    I haven’t yet found whether javascripts are also cached, but I suspect that they are. If not, please feel welcome to tell me.

    Otherwise, does anyone have a suggestion how to reduce the page size to under 100Kb without removing graphics?
      • 25663 MODX Staff
      • 12,272 Posts
      Build small pages to begin with. MODx doesn’t add any extra bloat or code. smiley
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 6726
        • 7,075 Posts
        One thing you can do is not call prototype and script.aculo.us scripts in your template head if you don’t use them.
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 22815
          • 1,097 Posts
          MODx includes a large number of scripts in the default templates, and key functions add extra scripts to the head. So I’d be hard pressed to agree with "MODx doesn’t add any extra bloat or code".

          The most important thing to do when measuring the document weight is to ensure you are logged out. QuickEdit adds a little bit to the weight, in some cases even duplicating scripts that you already have. Search engines and users won’t see the site with QuickEdit active, so it is the best test.

          Here’s the figures on the default content, first page:

          Logged In (ie has QuickEdit)
          Documents (1 file) 5 kb
          Images (19 files) 22 kb
          Style Sheets (6 files) 22 kb
          Scripts (14 files) 193 kb
          Total 243 kb

          Logged Out:
          Documents (1 file) 4 kb
          Images (14 files) 21 kb
          Style Sheets (5 files) 18 kb
          Scripts (10 files) 181 kb
          Total 224 kb

          So logging out reduces all figures, but still leaves Scripts as the weightiest part.

          Default Content Scripts: (logged out)
          manager/media/script/scriptaculous/prototype.js 60 kb
          manager/media/script/scriptaculous/effects.js 33 kb
          manager/media/script/scriptaculous/dragdrop.js 31 kb
          manager/media/script/scriptaculous/controls.js 28 kb
          manager/media/script/scriptaculous/slider.js 11 kb
          assets/snippets/AjaxSearch/AjaxSearch.js 6 kb
          manager/media/script/scriptaculous/builder.js 4 kb
          assets/templates/modxhost/moo.fx.js 3 kb
          manager/media/script/scriptaculous/scriptaculous.js 2 kb
          assets/templates/modxhost/drop_down_menu.js 2 kb

          which as David hinted at makes prototype the biggest hit.

          I’m not aware of search engines downloading JS, so you’re probably fine.
            No, I don't know what OpenGeek's saying half the time either.
            MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
            Forum: Where to post threads about add-ons | Forum Rules
            Like MODx? donate (and/or share your resources)
            Like me? See my Amazon wishlist
            MODx "Most Promising CMS" - so appropriate!
            • 25663 MODX Staff
            • 12,272 Posts
            I’ve never used a demo content template for a live site. Since it contains all the extra code, it’s going to output it. If you don’t include it when you’re building a site, it won’t. That is clearly not MODx adding code, but the template author. wink
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me