Hi folks
I’m working on a website whose purpose is to archive a large quantity of micro-publications.
I currently want to set up a page where users can filter all the publications with ‘city’ ou ‘country’ parameters. To do that I read the topics about filtering by tags etc and all is working !
But actually I’m struggling with the performance… Indeed, the website page takes about 4 seconds to load because of the large amount of publications to search in – about 8000 at the moment.
Here is the code I use in my controllers/publications.php
if($tag = param('pays')) {
$publications = $site->index()
->children()
->search($tag, 'origine')
->listed()
->paginate(50)
->filterBy('template', 'publication');
} elseif ($tag = param('ville')) {
$publications = $site->index()
->search($tag, 'ville')
->listed()
->paginate(50)
->filterBy('template', 'publication');
} else {
go(url('error'), 301);
}
return compact('tag', 'publications');
Can I do better to increase these bad performances …?
Thanks a lot !
Zellda