htaccess include_path性能

发布于 2024-12-02 19:27:50 字数 350 浏览 1 评论 0原文

我正在通过 ajax 加载一些内容。内容中有一个 require_once ,这似乎导致它在加载之前挂起至少一秒钟,这确实在页面上分散了注意力。我以前没有遇到过这些延迟,最近我唯一改变的是在 htaccess 文件中设置 php_include_path (C:/wamp/www/project) ..当我取出它时,它会立即加载(尽管它也没有找不到该文件)。

不过,这只是包含路径中的目录,所以看起来很奇怪,它会减慢速度(对吗?)。这是不正常的吗?我可以在哪里查找导致延迟的原因。

我有一个符号链接将我的文件和文件夹镜像到保管箱(以便我的保管箱文件夹在技术上位于它们所在的位置),但我将文件直接复制到 C:/wamp/www 中,并且速度缓慢仍然存在。

I am loading some content via ajax.. the content has a require_once in it that seems to be causing it to hang for at least one second before it loads, which is really distracting on the page. I haven't had these delays before, the only thing I've changed recently is setting a php_include_path (C:/wamp/www/project) in an htaccess file.. when I take it out it loads immediately (though it also doesn't find the file).

It's only that directory in the include path, though, so it seems strange it would slow things down that much (right?). Is that abnormal? Where could I look for what's causing the delay.

I have a symlink to mirror my files and folders to dropbox (so that my dropbox folder is where they are technically), but I copied the files directly into C:/wamp/www and the slowness persisted.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

木格 2024-12-09 19:27:50

我的建议是在 PHP 中定义 php include 路径,而不是在 .htaccess 中,看看是否可以加快速度。

例如,将其定义为常量

define('PHP_INCLUDE_PATH', 'C:/wamp/www');

My suggestion would be to define the php include path in your PHP, rather than in your .htaccess to see if that speeds it up.

For example, define it as a constant

define('PHP_INCLUDE_PATH', 'C:/wamp/www');
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文