加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

缓存 – Symfony2 bootstrap.php.cache文件的目的是什么?

发布时间:2020-12-18 00:19:23 所属栏目:安全 来源:网络整理
导读:我在我们的遗留项目之一使用SF2,而不是整个框架,而是通过拉入需要的捆绑包和组件.我一直想知道这些代码行: $loader = require_once __DIR__.'/../app/bootstrap.php.cache';require_once __DIR__.'/../app/AppKernel.php';//require_once __DIR__.'/../app/
我在我们的遗留项目之一使用SF2,而不是整个框架,而是通过拉入需要的捆绑包和组件.我一直想知道这些代码行:
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';

require_once __DIR__.'/../app/AppKernel.php';
//require_once __DIR__.'/../app/AppCache.php';

$kernel = new AppKernel('prod',false);
$kernel->loadClassCache();

我不知道这个bootstrap.php.cache文件是什么,它是什么,它是如何生成的(如果我不使用SF2整个框架).我以前没有使用过,没有问题,但是我想知道这是否可以给我一些性能提升等等,我应该研究一下.我试图找到周围,但找不到专门针对这个主题的文件.

解决方法

To ensure optimal flexibility and code reuse,Symfony2 applications leverage a variety of classes and 3rd party components. But loading all of these classes from separate files on each request can result in some overhead. To reduce this overhead,the Symfony2 Standard Edition provides a script to generate a so-called bootstrap file,consisting of multiple classes definitions in a single file. By including this file (which contains a copy of many of the core classes),Symfony no longer needs to include any of the source files containing those classes. This will reduce disc IO quite a bit.

资料来源:Use Bootstrap Files.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读