gpt4 book ai didi

codeigniter - 如何使 laravel 比 codeigniter 更快的页面加载

转载 作者:行者123 更新时间:2023-12-04 02:40:31 25 4
gpt4 key购买 nike

我是laravel的新手,它对编码很有好处,但它并不比codeigniter

快多少

我使用过 codeigniter,它的页面加载小于 5MB,但 laravel 页面加载可能与 8MB 相同。我想使用 laravel 但我需要建议让 laravelcodeigniter

更快

最佳答案

您有很多选项可以加快应用程序的速度:

1- run : php artisan optimize

2- disable the debugger

3- disable the services you don`t use in config.app file

4- if you are using homestead or vagrantBox this adds some sharedfolders that slows up the process.

5- if you are working in small,medium size project you can use lumen(lightweight version of laravel).

6-Cache your routes by running : php artisan route:cache

7-Cache your config by running : php artisan config:cache

其他一些与 laravel 相关的一般提示:

1-If you have data that is frequently fetched for example latest articles in a blog or top scores on a list try implementing a caching layer this would enhance your app performance drastically

2-Queues / back ground jobs , are very useful if you have some processes that take time and could be run in the background for example sending an email, crawling the web

并查看这些资源:

https://laracasts.com/discuss/channels/general-discussion/laravel-optimizations-or-speed-ups

http://ionut-bajescu.com/posts/view/improving-your-laravel-application-performance

Is Laravel really this slow?

https://mattstauffer.co/blog/laravel-5.0-route-caching

关于codeigniter - 如何使 laravel 比 codeigniter 更快的页面加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32941565/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com