The question of acceleration and optimization. Now my site is nearing its end on Modx revo. But pages can be loaded for 5-6 seconds, if without caching, with caching for 2 seconds. Visits - 0. Resource pieces 30. Used standard snippets. But I can not understand why the site can be so slow even without production. He wrote the site on the EVO, flies, even faster than when the cache is turned on. Maybe because I used samopisny snippets there? Is there any magic button that will increase the speed of the site several times? (I apologize for the kindergarten))

I understand, you need to think over the acceleration in place in each case in different ways. But you still expect from the new engine with a news site that it will not be so stupid without a special load, even taking into account the small mistakes made in the code

    4 answers 4

    "Использовал стандартные снипеты" - standard snippets are sooo slow. If you want speed, use pdoTools . Well, pthumb instead of phpthumbof. For 90% of cases - this is enough for the eyes, if not - look for snippets that slow down and deal specifically with them.

      There are some problems with speed, I agree with Vasis.

      standard soopps are sooo slow

      1. I was helped by moving the database to SSD. Significantly accelerated work. Requires investment in hosting.
      2. As a cheaper, but more difficult option - to install caching nginx

        First of all, check if your snippets are called recursively (getResources for the news list -> getResources in the chunk of each news, etc.).

        After that, check if you have explicit instructions not to cache output snippets (for example: [[! GetResources]]). You can prohibit caching only in cases that really require it.

        Smaller use any standard snippets like [[If]]

        Do not shoot the gun on the sparrows :) If you need some simple operation from a complex snippet (a degenerate example is to use getResources to get and output TV from a product) - put this functionality into your snippet.

        Finally, try transferring chunks and snippets from the base to disk. By default, they are in the database.

          If you need real acceleration, you need to forget about if is then else - i.e. remove all the logic made on this IF snippet. On a nearby resource, the war of the two camps warmed up, the point being that, having encountered such wrappers, ModX first processes all the embedded snippets and then checks the condition !! Those. no matter how conservative it may sound, it’s more correct to use different templates for very different pages! Not the way some people brag - "I have ONE template for everything about everything!" )))

          • And yet - call one snippet once per page! Sometimes you look and choke up tears)), as in the same Minishop2, people display goods on the category page, calling in the chunk a snippet of getting the option EVERY time for each product !!)) And this is a regular template! Well, it is clear why he is so, this template)))) - Sergey V.