Hello,
so, the title is my main question. Is there a plugin or something else to put all resources in the MODX cache?
I want to ask you, because I have some performance problems. The site I created is very slow (MODX Revolution 2.2.6-pl on an IIS Server with MySQL database), it has roundabout 300 resources (and it will be more in the next days) and 30 packages. All resources are linked together (e.g. the latest blog posts will be shown as teaser on an overview page; in addition the latest news and job offers are displayed in some overview boxes on the left/right of the content etc.)
The backend I configured is for members who have no experience in webdesign. So they can only add simple text. Images, table entries etc are template variables. Contact persons will be also shown as a template variable (checkboxes, the TV grabs all resources of a specific parent where all contact persons are included and settings are made (picture, email-adress etc)).
And much more...
And that is the problem of the bad performance I think. The site is very complex and contains many resources.
When one resource is updated, the whole MODX cache is cleared and it takes 3 to 30(!) seconds to load one page again. When I load it the second time it takes 1 to 3 seconds. The code [^p^] [^t^] [^s^] displays the time I needed and the source of the content (database or cache). And I realized that MODX takes the content of every page from the database when I update one resource. But fortunately I found the plugin "CacheMaster" which only clears the cache of the resource which is updated. So I save much time for all the other resources which cache files are fine and stay as they are.
The current status:
- visit page X the first time: takes 3 to 30 seconds (load from database)
- visit page X the second time: takes 1 to 3 seconds (load from cache)
- update page X: page X takes 8 to 30 seconds (load from database), but the other pages take 1 to 3 seconds (load from cache)
And my question again: How can all resources be put in the MODX cache automatically, preventing the updated page loading its content from the database. So basically the visitor should only get the content of the pages coming from the cache and not the database.
Best regards from Germany
Isabel
PS: I can't provide you with a link because I develop the site within the company's intranet.
System > system settings
Enable Database Cache = yes
Enable Database Session Cache - yes
also make sure you are calling all snippets cached.
Hi g5604,
thanks for your answer!
I already changed this settings and all snippets will be called uncached without "!".
And how can I put all into the MODX cache before the page will be load by a visitor?
I already installed xFPC, but it isn't the solution for my problem. The pages load faster with that snippet (and when I'm logged out), but only when I open the cached pages.
I'm searching for something, what creates the whole site cache without visiting all pages before. Do you know what I mean?
Take a look at the CacheMaster plugin. With it, the whole site cache is not cleared when you edit a Resource, just the cache for that resource.
Another option is the RefreshCache snippet, which will refresh the whole site cache. It's *very* slow however and could take a really long time to run on a big site.
Hi BobRay,
thanks for your answer!
I also installed the CacheMaster plugin (you can see in my first post). This works fine, but I want that a new or updated resource is automatically in de MODX cache without opening this page.
I tried out the RefreshCache snippet, but it doesn't do exactly what I want. The backend editors will create in the future new resources (or update existing resources) and these resources are not in the MODX cache. So the first visitor of this new or updated resource will need much time to open this page because it will be load directly from the database. I don't want the editors to push the refresh-cache-button everytime they do something.
So all in all I need a function to put the new (or updated) resources not only in the database but also directly in the MODX cache, without opening them first in a browser. Is this possible?
Hi exside,
thanks for you answer. I installed the Uncacher Addon.
Now the website loads fast when you opened the pages before. But when the backend editors create a new resource (e.g. a new blog post), then all pages where blog teaser are displayed become very slow.
Could it be something with the server? The administrator of the webserver told me that the server performance increased to nearly 100% and that is a no go. The reseon is definitely the MODX website. Could it be something with the MSSQL database?
And another point: The backend is also very slow. What could be the reason for that? The server admin tolds me that the server has a good performance. But anyway the site takes almost 100% of its performance. Do you know the reasons?
Thanks!
Regards, Isabel
[ed. note: dracovina last edited this post 13 years, 6 months ago.]
hm, i don't think this is a database issue (but I have no experience with IIS/Windows Servers + MODx) and for the 100% resource consumption, this looks like a severe leak or bad script somewhere (100% of memory or cpu?), that's not normal and probably also the issue for your slow page, because when the server is hammered that much it probably also takes the modx core down to act slowly bc of not enough resources.
what I would be interested is a list of your installed extras. Some known bottleneck creating extras are phpthumbof (especially the cache-checker-plugin) and also the official ElementHelper Plugin (which creates modx elements from static files) with a lot of static elements in the target folders (I rewrote it with modx caching functionality, then it's fast), but there are probably also others.
I would try to disable plugin by plugin and see if its getting better. if that doesn't help, wrap each chunk and snippet into the Executioner snippet from Jason which logs the execution time that it takes to process snippets and chunks, so you may be able to see what takes so long...