How much does using htaccess files slow down website performance (especially with solid state disks)?

后端 未结 6 1033
盖世英雄少女心
盖世英雄少女心 2020-12-15 04:38

The Apache docs say (http://httpd.apache.org/docs/2.4/howto/htaccess.html),

\"You should avoid using .htaccess files completely if you have access t

6条回答
  •  无人及你
    2020-12-15 05:14

    I quote from a tutorial on .htaccess by Joseph Pecoraro on code.tutsplus.com here:

    Also, when [.htaccess is] enabled the server will take a potential performance hit. The reason is because, every server request, if .htaccess support is enabled, when Apache goes to fetch the requested file for the client, it has to look for a .htaccess file in every single directory leading up to wherever the file is stored.

    These potential file accesses (potential because the files may not exist) and their execution (if they did exist) will take time. Again, my experience is that it's unnoticeable and it doesn’t outweigh the benefits and flexibility that .htaccess files provide developers.

    For your scenario, my personal recommendation would be like "Don't fix what isn't broken", because time and effort is equal to money, and I fully agree with your reasoning in this comment.

提交回复
热议问题