Slow page loads
Created 8 years ago by gwernerI'm only in local development at the moment, but pages are loading pretty slowly. This is a fresh install I've only just started taking a look and haven't developed anything at this point. The admin panel at the bottom show page load in 4-5 secs. Is this normal? Is there a setting that needs changed? This might be a nit pick, but during local development fast refresh is preferred. Any ideas?
I 100% agree! Fast refresh is paramount. Speed almost always comes down to the autoloader. Try dumping an optimized autoloader and I'm not a vagrant pro but if you're using that make sure the disk allocation is not shared. I'll point to some others here as I've not had many issues with speed myself to overcome.
What operating system are you on? Are you on an SSD? Are you serving files from a VM (particularly VBox)? Where is the MYSQL server running? What version of PHP are you running?
Hey @gwerner, can you give us more information on your enviroment?
OS/PHP version/any specialties (docker/vagrant).
Few things that i know have helped alot of people, if possible, use an SSD, pyro checks a shit ton of files and it helps alot, 2nd (prob the biggest thing you can do) is use PHP 7. It is CRAZY how much faster just using php7 can make it.
Hey all, thanks for the replies. First, I'm on a Mac and using the latest homestead I believe. So, vagrant, virtual box, PHP 7.0.8. It looks like Zend opcache is also running. I'm also using an SSD as well. I've not heard of valet, I'll check it out. Beyond that I wouldn't think there should be too much to setup? But, I could be wrong. I've done multiple installations of plain Laravel and not had a problem with speed.
Here is a link to Valet: https://laravel.com/docs/5.3/valet
Since we both have this issue, i will try to find the time to look into it over the weekend. Hopefully i can figure out why it is so slow on homestead. However, Valet will probably be faster than Homestead anyway. So go get it😄
/W
Thanks again for the feedback. I did get this sorted out this morning. Homestead isn't using NFS by default. All I needed to do was add the type: nfs to my Homestead.yaml and now Pyro loads in under a second. It looks like NFS is off by default on Homestead because Windows doesn't support it.
folders:
- map: ~/Code/Template
to: /home/vagrant/Code/template
type: nfs
Excellent! Ill have to remember that.. or better yet start using Homestead and become more knowledgable on the matter 🙍
Glad you got it sorted!
@ryanthompson Will do and honestly I only was turned on to NFS by a github issues from Aug. 2015 that you replied to with someone else having this issue. Or at least a similar issue.
Thanks again for the feedback. I did get this sorted out this morning. Homestead isn't using NFS by default. All I needed to do was add the type: nfs to my Homestead.yaml and now Pyro loads in under a second. It looks like NFS is off by default on Homestead because Windows doesn't support it.