Wbiłem dzisiaj na swoją stronę napisaną na symfony 2.7 i okazało się, że strona wczytuje się z 15 sekund... Od dobry paru tygodni nic tam nie dotykałem w kodzie i do bazy również nic nie przybyło.
Z 2 tygodnie temu wszystko śmigało aż miało. Strona śmiga na php 7.
Hostuję stronę na mydevil.net
Screeny z debugera:
http://imgur.com/a/IsXdL
Cache wyczyszczone, aktualizację bundli zrobione.
Dodam jeszcze, że na każdej podstronie tak zamula. Nawet na takiej gdzie jest sam widok...
Przykład kodu front_page:
<?php namespace Acme\Bundle\FrontBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Request; use Acme\Bundle\FrontBundle\Form\ContactType; use Acme\Bundle\AdminBundle\Entity\Studio; class PageController extends BaseController { /** * @Route("/", name="front_home") */ public function indexAction() { $this->view_data['breadcrumbs'][] = array('title'=>'home page','url'=>$this->get('router')->generate('front_home')); $this->view_data['global']['subtitle'] = 'Home Page'; $em = $this->getDoctrine()->getManager(); $qb = $em->createQueryBuilder(); $qb->select('s') ->from('AcmeAdminBundle:Studio', 's') ->orderBy('s.id', 'DESC') ->Join('s.idCompany', 'c') ->where('s.active = 1') ->andWhere('c.active = 1') ->setMaxResults(6); $result = $qb->getQuery()->getResult(); $this->view_data['studios'] = $result; $this->view_data['metatags']['title'] = 'Home Page'; return $this->render('AcmeFrontBundle:Page:index.html.twig',$this->view_data); }
Proszę o pomoc