We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43592
    • 97 Posts
    Hi forum,

    My site http://www.rottmayr-akademie.eu/ is incredibly slow sometimes and I dont know what do do.

    I've another modx site on the same server which is super-speedy and I see no difference.

    What I already did: My wayfinder calls are all cached [[Wayfinder .., I put opcache on site, Ive the newest php and modx version 2.5.4), I limit getressources, i did no special cache settings, i put the following code in .htaccess

    <IfModule mod_expires.c>
    ExpiresActive on
    ExpiresByType text/javascript "access plus 7 days 1 hour"
    ExpiresByType application/javascript "access plus 7 days 1 hour"
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 month"
    ExpiresByType text/css "access plus 1 month"

    <IfModule mod_headers.c>
    Header append Cache-Control "public"
    </IfModule>
    FileETag none
    </IfModule>

    But the site wont get faster. What I experience is sometimes when I click though pages than the cache is built and the page speeds up. Next day the page is slow again although I didtn empty the cache.

    F.e this page is sometimes really slow (45 seconds) http://www.rottmayr-akademie.eu/veranstaltungskalender/.
    Next day it is incredibly fast again. So it seems that the cache is lost automatically??

    Im a little bit out of idea now... any suggestions?

    This question has been answered by multiple community members. See the first response.

    • discuss.answer
      • 44064
      • 185 Posts
      Hi,
      Could you share your getResources and Wayfinder calls(with parameters) for deeper investigation?
      Also pdoTools instead can help you here a bit.
      Here is helpful link: https://gtmetrix.com/reports/www.rottmayr-akademie.eu/6hbx5En3
      Please check all the tabs, as we can see here there are a lot what you need to compress(enable gzip, minify all js,css) and improve client-side speed optimization too.
      For some reason light-weight images take a lot of time for loading..that's strange.Please double check all caches,for phpthumbof too..also suggest you to use pthumb instead of phpthumbof, it's faster.

      Don't hesitate to ask other questions. [ed. note: himurovi4 last edited this post 9 years, 8 months ago.]
        Anton Tarasov
        MODX Developer

        Email: [email protected]
        Web: antontarasov.com
        • 44064
        • 185 Posts
        Link said that expired headers don't work, gzip also can help a lot(don't work now). And one other way - use subdomain without cookie for static elements (css,js,images).Just create something like s.domain.tld and link it to the same hosting folder as current domain, then point full URL address for all static elements you want to load ther...f.e. http://s.domain.tld/fonts/styles.css instead of /fonts/styles.css and so on...
          Anton Tarasov
          MODX Developer

          Email: [email protected]
          Web: antontarasov.com
          • 43592
          • 97 Posts
          Thank you himurovich, that helped already a lot!

          One of my Wayfinder calls would be [[Wayfinder? &startId=`0`&level=`0`&hereClass=`current`&outerTpl=`outerTpl` &excludeDocs =`47,211`]]

          or getressources: [[getResources? tpl=`events_tpl` &parents=`39` &includeContent=`1` &includeTVs=`1`&processTVs=`1`&limit=`450` &showHidden=`1`&sortbyTV=`Kursart` &sortdirTV=`ASC`&tvFilters=`Kursart==%[[*description]]%` ]]

          I know 450 is pretty much ..

          I've PDO-Tools installed but I'm totally a beginner on it. So maybe you've a quick line of code ... THX!!
          • discuss.answer
            • 22840
            • 1,572 Posts
            If you have PDO tools installed try swapping them out for the replacements:

            Replace wayfinder with the following:

            [[pdoMenu? &startId=`0`&level=`0`&hereClass=`current` &outerTpl=`outerTpl` &excludeDocs =`47,211`]]


            getRoources:

             [[pdoResources? tpl=`events_tpl` &parents=`39` &includeContent=`1` &includeTVs=`1`&processTVs=`1`&limit=`450` &showHidden=`1`&sortbyTV=`Kursart` &sortdirTV=`ASC`&tvFilters=`Kursart==%[[*description]]%` ]]


            With the pdoResources one consider adding the &prepareTVs telling it what tv's will be included so that it's not running through every tv

            PDO tools is virtually the same as what it replaces so there shouldn't be any issues, but for reference:

            https://docs.modx.pro/en/components/pdotools/snippets/pdomenu
            https://docs.modx.pro/en/components/pdotools/snippets/pdoresources
            • discuss.answer
              • 44064
              • 185 Posts
              Thanks @Paulp for the detailed and fast answer! Agree that $prepareTVs should be removed if isn't needed factically.
              My little amendment to codes above: just general advise - please specify as much criterias as you have and remove all unnecessary fields. So I would update the code above in the next manner:

              [[pdoMenu?
              	&startId=`0`
              	&level=`0`
              	&hereClass=`current`
              	&outerTpl=`outerTpl`
              	&excludeDocs =`47,211`
              	&depth=`1`
              	&where=`{"template:IN":[1,2,3,4}`
              	
              ]]


              [[pdoResources?
              	&tpl=`events_tpl`
              	&depth=`1`
              	&parents=`39`
              	&includeContent=`1`
              	&includeTVs=`TV1Name, TV2Name`
              	&limit=`450`
              	&showHidden=`1`
              	&sortbyTV=`Kursart`
              	&sortdirTV=`ASC`
              	&tvFilters=`Kursart==%[[*description]]%`
              	&where=`{"template":3}`
              	&select = `{"modResource":"id,pagetitle,uri"}`
              ]]


              Please specify &depth(as min as you can for correct output), &where(also useful db key for faster searching) and &select(only needed fields, shorter db query is a bit faster too), this will speed up the loading. Also pay attention to the fact &includeTVs have comma-separated list of TVs you show(if any)

              Also pay attention to additional &cacheTime (https://docs.modx.pro/en/components/pdotools/general-settings)

              Here is other helpful link for working with &where parameter content: https://docs.modx.com/xpdo/2.x/class-reference/xpdoquery/xpdoquery.where
                Anton Tarasov
                MODX Developer

                Email: [email protected]
                Web: antontarasov.com
              • discuss.answer
                • 3749
                • 24,544 Posts
                When I loaded your page, this request took 12 seconds: http://www.rottmayr-akademie.eu/css/fonts/icomoon.woff
                and the slider took 7 seconds. A number of the other requests spent several seconds in the queue before downloading.

                I suspect that using sprite images might make a big difference:

                http://spriteme.org/

                https://css-tricks.com/spriting-img/

                  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
                  • 43592
                  • 97 Posts
                  @himuroviv, @BobRay and @Paulp

                  Thank you for your responses which solved already a lot.

                  May main problem is still

                  http://www.rottmayr-akademie.eu/veranstaltungskalender/ which has a loading time of 45 seconds or more sometimes although "gtmetics" says 3.5 seconds.

                  I use

                  [[pdoResources?
                  &tpl=`events_tpl`
                  &depth=`1`
                  &parents=`39`
                  &includeContent=`1`
                  &includeTVs=`TV1Name, TV2Name`
                  &limit=`450`
                  &showHidden=`1`
                  &sortbyTV=`Kursart`
                  &sortdirTV=`ASC`
                  &tvFilters=`Kursart==%[[*description]]%`
                  &where=`{"template":3}`
                  &select = `{"modResource":"id,pagetitle,uri"}`
                  ]]

                  now which didnt "solve" it
                  (without &where on the page now because I dont know what is {"template":3}. I tried to indicate the template (28), where the call is in, but this didnt work.)

                  I still have loading problems on this page, but Im not sure what it could be. It feels like the cache is littered after one day.

                  Generally the (php)-pages "themselves" seem to have a exended "loading/waiting" time irrespective of sprites etc. which load slowly.
                  Those documents have a few KB's .. and Im waiting seconds till they come out of the system.
                  When you say buy more prozessor power this would also be ok but I dont know if this is the solution. As mentioned Ive another web running on this server which works like a charm ..

                  Thanks, Stefan [ed. note: sspind last edited this post 9 years, 8 months ago.]
                    • 43592
                    • 97 Posts
                    Hi!

                    After some investigation the main problem and difference between the other webpage running seems to be, that on editing and saving every ressource the whole modx cache is rebuilt. This is a multiuser system and users put in ressources via Newspublisher and Formit all the time, so thats a problem. Would more processors (6 instead of 4 help or doesnt do that anything?)

                    I sneeked into "getCache" (https://www.sepiariver.ca/blog/modx-web/advanced-cache-management-to-turbocharge-your-modx-sites). Im a totally beginner on that because I never had that case.

                    Maybe you have some best practice Tipps on caching content/ressources created by

                    - Content Editors
                    - Newspublisher Content
                    - Formit

                    I installed Bob Ray's Cachemaster which seems to help already.

                    Thanks!
                    [ed. note: sspind last edited this post 9 years, 8 months ago.]
                      • 47717
                      • 144 Posts
                      Quote from: sspind at Jan 09, 2017, 02:50 AM
                      @himuroviv, @BobRay and @Paulp

                      Thank you for your responses which solved already a lot.

                      May main problem is still

                      http://www.rottmayr-akademie.eu/veranstaltungskalender/ which has a loading time of 45 seconds or more sometimes although "gtmetics" says 3.5 seconds.

                      I use

                      [[pdoResources?
                      &tpl=`events_tpl`
                      &depth=`1`
                      &parents=`39`
                      &includeContent=`1`
                      &includeTVs=`TV1Name, TV2Name`
                      &limit=`450`
                      &showHidden=`1`
                      &sortbyTV=`Kursart`
                      &sortdirTV=`ASC`
                      &tvFilters=`Kursart==%[[*description]]%`
                      &where=`{"template":3}`
                      &select = `{"modResource":"id,pagetitle,uri"}`
                      ]]

                      now which didnt "solve" it
                      (without &where on the page now because I dont know what is {"template":3}. I tried to indicate the template (28), where the call is in, but this didnt work.)

                      I still have loading problems on this page, but Im not sure what it could be. It feels like the cache is littered after one day.

                      Generally the (php)-pages "themselves" seem to have a exended "loading/waiting" time irrespective of sprites etc. which load slowly.
                      Those documents have a few KB's .. and Im waiting seconds till they come out of the system.
                      When you say buy more prozessor power this would also be ok but I dont know if this is the solution. As mentioned Ive another web running on this server which works like a charm ..

                      Thanks, Stefan

                      Hi the miracle cure:

                      just install "XFPC" caching module (while disabling other caching plugins).

                      You will experience lightning speed, as all pages are converted to compressed html-files.

                      cheers !