We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4338
    • 4 Posts
    I run FilmJuice.com. It looks lovely and shiny on the outside (if not bit overloaded with information per webpage) but the back end is a complete mess since we were cursed with a developer who did not have a clue what he was doing. He created a series of files, within files, within files etc (you get the picture) which meant, that at one point, it needed to make 5000 calls just to get the homepage up. I’ve been advised by a more sane developer grin to start again. I would like to see if anyone has any suggestions before I do so. I don’t mind painstakingly going through everything to get the current site to work, if need be. Any advice appreciated!
      • 791
      • 46 Posts
      I for one can highly recommend MODx... Incredibly flexible, which means that regardless of design you can have what you want where you want it. And Template Variables are a revelation - user-editable pieces of content outside the main content block, anywhere on the page. So you’ll have a series of TV’s for the film title, release date, plot, cast, director, etc. You’ll love it. Plus the MODx community is great and very helpful and quick to respond.

      I’ve been developing on MODx for a couple of years now and I wouldn’t look anywhere else.
        Learning a little more each day.
        • 4338
        • 4 Posts
        Oh, don’t get me wrong. Perhaps my lack of tech speak at play here. Problem is not the software but the poor excecution in it’s development. Just seeing if anyone had any advice, is all.
          • 33968
          • 863 Posts
          I think aksteven misunderstood; you’re actually running the site on modx already.

          5,000 calls is wayyyy too much - are you sure that’s correct? It seems to have been cached correctly and the site (home page anyway) loaded very quickly for me.

          What’s the problem exactly. Is something broken on the site or are you experiencing any performance issues? Or just finding the site difficult to maintain because of the way it’s been built? If you’re not familiar with MODx I could understand how it could appear a bit ’files inside files’.

          It’s a bit difficult to give you any advice without seeing the code or file structure, can you post some examples?
            • 4338
            • 4 Posts
            Thanks for getting back to me. Believe me, with my limited tech knowledge I have taken several measures to get it to its current speed. But, based on the way that it is built in the back end, one day, it will crash and burn unless I deal with it. ie the more films we add, the slower the website becomes. I literally purge the site of files on a daily basis.

            The following is an email sent by our concerned host when the site slowed down/ killed the entire server (we’ve now been placed on a private server as a temporary measure). I think it sums up the problem:

            "I have had a look around the film juice website today and have seen that it is still slow in places. So I had a look in the MODx manager and created a copy of the home page called XXX and also copied the home page template "XXXX".

            I am finding with just one ditto call that the time it takes is just under 1 second the ditto call I was looking at is:

            [[Ditto? &randomize=`1` &debug=`1’ &parents=`83` &depth=`0` &display=`5` &orderBy=`fj_homepage_priority ASC,pub_date DESC` &tpl=`fj_chunk_largearticle_dyn` &filter=`fj_homepage_startdate,[[fj_snippet_currentdate]],4|fj_homepage_enddate,[[fj_snippet_currentdate]],3|fj_homepage_priority,2,4|fj_pagenumber,1,1|fj_articletype,Review,1|fj_medium,Cinema,7`]]

            Debug Mode showed that over 1800 pages were being scanned just to retrieve a few results.

            I then reduced the filter query to only look at the documents which use template 9 (fj_film_review_article) as your original Ditto call is only interested in review articles, I thought that filtering on the template = 9 would reduce the number of pages Ditto looks through, however I found that no matter what I set the filter options to Ditto is always reading through almost 2,000 Pages.

            [!Ditto? &randomize=`1` &parents=`83` &debug=`1` &showPublishedOnly=`1` &depth=`0` &display=`5` &orderBy=`fj_homepage_priority ASC,pub_date DESC` &tpl=`fj_chunk_largearticle_dyn` &filter=`template,9`!]</div>

            What might speed this up is perhaps if you restructure the document tree in MODx i.e.

            Films (97)
            -- Reviews (98)
            ------- A
            ------- B
            ------- Z
            -- Trailers (99)
            ------- A
            ------- B
            ------- Z
            -- Gallery (100)
            ------- A
            ------- B
            ------- Z

            You could then store your film reviews in the relevant folder under the relevant letter, and trailers in the separate folder / letter, by doing so you could then set the ditto call to be more specific I.e. get articles from folder 98 instead of everything from folder 97.

            When I searched the database for just pages which are review pages I got around 400 records, another option is that you don’t use Ditto and create custom snippets which can drill down to the data much quicker than ditto for example this query :

            SELECT fj_site_content.id from fj_site_content LEFT JOIN fj_site_tmplvar_contentvalues ON fj_site_tmplvar_contentvalues.contentid = fj_site_content.id WHERE fj_site_content.template = 9
            AND fj_site_tmplvar_contentvalues.tmplvarid = 20 AND fj_site_tmplvar_contentvalues.value LIKE ’%CINEMA%’ LIMIT 0,5

            Takes MySQL 0.0014 seconds to execute.

            Writing custom snippets for the site would be a big job though, let me know what you think to the above, I could clone the site to a dev area so you can try my suggestions out, I can also assist with moving specific template pages into a new folder direct in the database to save time moving them one by one in MODx"


            I hope this explains it all - I have since removed Gallery and most of trailers.

            I look forward to ANY advice! tongue
              • 32316
              • 387 Posts
              try your site on http://validator.w3.org/

              (these are problems with your html template)



                • 33968
                • 863 Posts
                Honestly, this is too big a job to accomplish by a back-and-forth in the forums. I think you would be better off getting a developer to sort it out for you. Without access to your manager panel and database it would be like stabbing in the dark.

                I understand some work has been done on the home page and it appears to be well optimised. But trying again now and your site doesn’t load. If the site continues to grow you will probably run into more problems in the future.

                As has been suggested, you’ll need to at least optimise your folder setup (and adjust all your Ditto or custom snippet calls accordingly). However with the amount of resources you are dealing with you might be better off having them managed by a custom database table that is optimised for that purpose.

                Sounds like you’ve got some pretty good advice already from someone who knows their way around MODx - I’d get them back in, pronto!

                  • 4338
                  • 4 Posts
                  Thanks everyone! wink