tires Posted 3 hours ago Share Posted 3 hours ago 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 More sharing options...
AndZyk Posted 3 hours ago Share Posted 3 hours ago 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 1 Link to comment Share on other sites More sharing options...
tires Posted 2 hours ago Author Share Posted 2 hours ago 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"); }); 1 Link to comment Share on other sites More sharing options...
da² Posted 38 minutes ago Share Posted 38 minutes ago 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. Link to comment Share on other sites More sharing options...
AndZyk Posted 29 minutes ago Share Posted 29 minutes ago Happy to hear you found the issue. 😀 You could consider indexing the pages with a Lazy Cron or a cronjob. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now