.htaccess redirect performance

前端 未结 3 450
野的像风
野的像风 2021-01-17 15:44

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 st

3条回答
  •  既然无缘
    2021-01-17 16:09

    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.

    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)

提交回复
热议问题