乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      php-css和JS文件下載時間太長

       印度阿三17 2019-05-19

      我有一個在linux服務(wù)器上用cakephp編寫的網(wǎng)站.我的css和js文件的下載時間非常慢,我遇到了問題.例如,在加載我的主頁時,這就是chrome中的網(wǎng)絡(luò)選項卡:

      enter image description here

      如您所見,我的一個css文件花了59秒下載!重要的是要注意它并不總是相同的css文件.有時它的JS文件,有時是其他css,但它們必須在顯示頁面的其他內(nèi)容之前下載,因此它們會阻止頁面加載.由于等待下載該文件,因此網(wǎng)站不會顯示59秒.

      我檢查了我的服務(wù)器,它的負(fù)載非常低,cpu運行10%,并且使用的ram不到20%.它是一個帶有以下prefork設(shè)置的apache服務(wù)器:

      StartServers       10
      MinSpareServers    10
      MaxSpareServers    20
      ServerLimit        256
      MaxClients         256
      MaxRequestsPerChild  10000
      

      這提到的下載時間很慢,網(wǎng)站上可能有3-4個同時用戶.我在AppM下使用appdynamics我的應(yīng)用程序,沒有任何可疑的顯示在那里.我用服務(wù)器管理員檢查了php.ini文件,一切似乎都很好.我可以使用哪些其他軟件來查找此問題的來源? apache日志中的信息也不多.

      任何建議將不勝感激

      編輯:

      我將所有資產(chǎn)都移到了webroot,并在另一個使用同一服務(wù)器的域上獲得了這些結(jié)果:

      enter image description here

      正如您所看到的,這次它的jquery文件需要27秒才能下載.它存儲在app / webroot中

      解決方法:

      Ill take a look at serving assets from webroot

      始終將公共資產(chǎn)放在webroot中.

      From the book(重點補充):

      It’s a well known fact that serving assets through PHP is guaranteed to be slower than serving those assets without invoking PHP. And while the core team has taken steps to make plugin and theme asset serving as fast as possible, there may be situations where more performance is required. In these situations it’s recommended that you either symlink or copy out plugin/theme assets to directories in app/webroot with paths matching those used by CakePHP.

      • app/Plugin/DebugKit/webroot/js/my_file.js becomes app/webroot/debug_kit/js/my_file.js
      • app/View/Themed/Navy/webroot/css/navy.css becomes app/webroot/theme/Navy/css/navy.css

      根據(jù)許多因素,“較慢”可以介于幾乎不可察覺到幾乎無法使用的任何地方.

      此建議不是特定于版本的,并且?guī)缀蹩偸沁m用.為了加快資產(chǎn)加載速度,讓網(wǎng)絡(luò)服務(wù)器為您處理這些問題.

      來源:http://www./content-1-197951.html

        本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多