简体   繁体   English

Laravel,在本地主机/ Windows上放慢静态内容

[英]Laravel, slow static content serving on localhost/windows

I'm developing laravel appliaction on windows enviroment (artisan) and I'm having some non-criticial but annoying speed issues. 我正在Windows环境(工匠)上开发laravel应用程序,并且遇到了一些非批评性但烦人的速度问题。 First of all, I'm not talking about DB access, speed is issue with serving static content and maybe not related to laravel: 首先,我不是在谈论数据库访问,速度是服务于静态内容的问题,并且可能与laravel不相关:

  • I start with php artisans serve 我从php artisans serve开始
  • Then open app in browser some static content http://127.0.0.1:8000/js/script.js 然后在浏览器中打开应用程序一些静态内容http://127.0.0.1:8000/js/script.js
  • It serves tiny javascript file and takes 204ms(!) 它提供了很小的javascript文件,耗时204ms(!)
  • When I publish same file on (shared) hosting enviroment, it takes < 45ms. 当我在(共享)托管环境上发布相同文件时,它花费的时间少于45毫秒。

I belive it is related to windows environment but don't know how to speed up a little bit. 我相信它与Windows环境有关,但不知道如何加快速度。 Same situation is with any static content and when I execute this as whole app ( http://127.0.0.1:8000/ ) it takes few seconds to execute something very basic. 对于任何静态内容,情况都是相同的,当我将其作为整个应用程序执行时( http://127.0.0.1:8000/ ),执行一些非常基本的操作需要花费几秒钟。

I have decent computer (win8.1, 64bit, i5, 3.4Gh, SSD disk). 我有不错的计算机(win8.1、64bit,i5、3.4Gh,SSD磁盘)。

I think php artisan serve doesn't effect loading speed. 我认为php artisan serve并不会影响加载速度。 If you want to test it, then you can also access project by not using this command. 如果要测试它,则还可以通过不使用此命令来访问项目。 Instead directly access it by 而是直接通过

http://localhost/your-project-folder/public

hope it will help you. 希望对您有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM