Jump to content

Website has become extremely slow


tires
 Share

Recommended Posts

I have a site with about 5000 subpages and have noticed that it now takes about 10 seconds to save a page.

What could be the reason for this and how can I speed up the site?

Link to comment
Share on other sites

Hello @tires,

have you tried looking in TracyDebugger if there is an error?
Do you use hooks or special modules?

The amount of subpages should not be an issue in my experience.
Maybe there is something else going on.

Regards, Andreas

  • Like 1
Link to comment
Share on other sites

Thank you very much for your advice!

I have indeed found a hook that was apparently to blame. I can't remember exactly why I added it and what it does ...

$wire->addHookAfter('Pages::saveReady', function($event) {
  $event->modules->get('SearchEngine')->indexPages();
  $page = $event->arguments(0);
  $event->wire('log')->save('Page saved', "Page ID: $page->id / Page Name: $page->name / Page Parents: $page->parents");
});

 

  • Like 2
Link to comment
Share on other sites

2 hours ago, tires said:
$event->modules->get('SearchEngine')->indexPages();

You are indexing all the site pages every time a page is saved. You should index only this page since the work for other ones was already done.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...