📜 ⬆️ ⬇️

Radical caching in Joomla 1.5

image

A free CMS is always a compromise, a compromise between a number of obvious factors, which, it seems, it makes no sense to list which within this resource. they are all known for a long time. Of course, among the whole variety of free CMS, some can be distinguished that will be better or worse in some separate nominations, such as work speed, ease of mastering by a beginner, etc. But this article is not about that. I just want to share the experience of successfully solving the problem of page generation speed in Joomla using caching. And caching is very radical, at the “level” index.php.

I want to immediately note that this story is not some fundamental innovation, and I do not claim any laurels. I hope my decision will help at least someone to extend the “little blood” life of the old project on Joomla.

')
I just want to preempt the criticism and ask for some indulgence. The fact is that I am not a professional programmer in any way. I am the technical director of a small printing house. All my programming efforts are just efforts to reduce IT costs in a company.

As it seems to me, quite typical (in any case, among amateur programmers, whom I consider myself to be) is the following situation. At one time, when I started writing a website for myself, I chose Joomla, because it was an obvious, though not very far-sighted, decision. Over time, I encountered some limitations of Joomla, one of which was the time of page generation.

For those who are in the subject, it's probably not a secret that due to the load of a heavyweight framework, plug-ins and modules, well, as a payment for the versatility of CMS as a whole, the typical page generation time can be about 1-2 seconds. The use of more powerful hardware does not solve the problem, because if a CMS makes several dozen (or even a hundred) requests to the database for one request, an increase in the productivity of iron (and all its components) will be required by an order of magnitude, which is very expensive, to say the least.

I must say that joomla 1.5 itself also knows something in terms of caching. To my shame, I do not remember exactly what, because a long time to delve into it. But I do remember exactly that there is almost no sense in this caching.

The first attempt to optimize and accelerate was writing a crutch for caching the Joomla component Virtuemart. Virtuemart is a well-known (we can say "classics of the genre") component of the online store for Joomla. Of course, you can say a lot of unflattering words about him and read, because it has a lot of flaws dictated by a number of reasons, ranging from respectable age, the absence of any refactorings there, ending with openness and versatility, which, as a rule, go alongside cumbersome. Nevertheless, it (Virtuemart) is there, it works, and for many it is a simple entry point into the “world of electronic business”, so to speak. And in general, I would like to focus not on how to “properly cook” Joomla, which components and how to use. On the contrary, I would like to share a recipe for what to do if it is already cooked incorrectly. A solution that can be briefly described as “Don't touch anything, don't change anything, just make it faster so that it works faster!”

In my case, Virtuemart is used in directory mode, which somewhat simplified the task of writing a caching crutch. Describe how I did it makes no sense, because the resulting increase did not significantly affect the download speed. After all, in my Joomla there are more components that love resources, for example JoomFish. In addition, in order for Virtuemart to give up its cache, you need to load the entire Joomla framework all the time, which in itself takes time.

I started looking for a solution to speed up the download. The situation was aggravated by problems on the virtual hosting, where my neighbors had archineoptimal websites, and therefore the server was very loaded and the generation time sometimes reached 10-20 seconds.
Upon reflection, I came to the conclusion that no joomla optimization, at least within reasonable aisles — after which joomla will remain a joomla, will not accelerate at times, and this is the goal that stood before me. Therefore, it was decided to consider the writing of the frontend. I immediately dropped it and did not consider options with ready-made solutions (I don’t even know if there are any), since He had neither desire nor time. In addition, my copy of joomla is decently finished in places and typical (typical for Joomla) solutions are not the fact that they would work out of the box.

What happened as a result:


Consider the implementation



Actually that's all. As a result, I received an acceleration of almost an order of magnitude (almost ten times).

image

Results tracker
Physically hosting is in Kiev, 99% of the target audience there.
You can estimate the speed of the site on it: link

In the picture below - a screen from Google Webmasters Tools

image

The February spike was caused by one problem, for which I had to delete the entire cache of the frontend every 2-3 days during the whole month. But this problem itself had no relation to the frontend.

The front end cache is cleared from the joomla admin panel; to do this, I didn’t have to do anything, except to add the cache itself to the daddy / cache / FrontEnd - joomla saw it itself and provided an opportunity to clear it ...

PS: I am sure that this approach can be applied not only within Joomla 1.5 and not only within Joomla. Of course, this will require some skills, but, at the same time, it can expand the scope of easy-to-learn free CMS.

Thanks for attention.

Source: https://habr.com/ru/post/139177/


All Articles