htaccess的重定向性能 [英] .htaccess redirect performance

查看:224
本文介绍了htaccess的重定向性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是htaccess的重定向任何较慢/把更多的压力比Apache的配置文件中的重定向?此外,如何能大一些htaccess的重定向获得开始降低性能才?

Are htaccess redirects any slower/put any more strain on Apache than redirects in configuration files? Also, how big can a number of redirects in htaccess get before they start decreasing performance?

推荐答案

是的,它减缓了服务器,因为它每一次访问该文件的资源在该目录或访问它们的任何子目录。

Yes, it slows the server because it has to access the file each time a resource in that directory or any subdirectory thereof is accessed.

重定向的量是不相关的,因为主要的性能命中的文件访问本身。这种合理的约束范围内(即5 KB htaccess文件将采取更多或更少的同时比1 KB的一个被解析,不同的故事是1MB的htaccess的,但我从来没有见过的怪物,并希望我永远不会)

The amount of redirects is not relevant, because the main performance hit is the file access itself. This within reasonable constraints (ie a 5 Kb htaccess file will take more or less the same time to be parsed than a 1 Kb one, different story is a 1Mb htaccess, though I've never seen that monstrosity and hope I never will)

这篇关于htaccess的重定向性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆