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!