DEV Community

Discussion on: Please remove that .git folder

Collapse
 
corentinbettiol profile image
Corentin Bettiol • Edited

(I use it in my sites-enabled/ folder because adding .htaccess files are slowing down apache and my server is not very powerful :P)

You should avoid using .htaccess files completely if you have access to httpd main server config file. Using .htaccess files slows down your Apache http server. Any directive that you can include in a .htaccess file is better set in a Directory block, as it will have the same effect with better performance.
httpd.apache.org/docs/2.4/howto/ht...

The httpd.conf is parsed one time. If you use .htaccess it'll get hit every time something is called. That'll cause a fairly large performance hit that will just get worse with increasing requests.
stackoverflow.com/a/25064109/6813732

Collapse
 
po0q profile image
pO0q 🦄

hello, the good news is you can manage it wherever you want, but do you have any figures or test results for the performances? I'd be curious to know why .htaccess would slow down the entire architecture, especially your number of hits.

Thread Thread
 
corentinbettiol profile image
Corentin Bettiol • Edited

I haven't done any test on my server, but I will quote another SO answer:

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.
stackoverflow.com/a/29114826/6813732

Some comments have been hidden by the post's author - find out more