Hi Boonex, Dolphin team,
I'm looking at optimising Apache and one of the things this involves is putting all items in .htaccess files into the main server configuration files, be that in a virtual host file or in the global section.
As you would know with Apache searching directory trees for .htaccess files on each and every request, this loads the server especially with so many users online.
In regards to the many .htaccess in Dolphin, is this possible? or is there a recommended way of performance enhancement other than going this route?
|
afair, .htaccess files are used to block access to cache and tmp directly. Its been so long since i used apache, I may be wrong here. so much to do.... |
Hi Prashank. Yes you are right, ./cache has a .htaccess in it with "Deny from all", but technically speaking, there's nothing in .htaccess which you can't move to a virtual server config file.
There's a performance hit on Apache scanning for .htaccess files on every request, and for a virtualised environment this does mean performance loss. This is why I'm hoping Boonex or Dolphin users have tackled this one before and there's a real solution for it? ie. if moving the directives to virtual server config, the ones to move and items to create etc.
Just out of interest, if you don't use Apache for Dolphin, what do you use?
|
I would the leave the .htaccess file in the root of the site and let Apache handle it. .htaccess file in the root is used to rewrite the URLs so they are pretty; permalinks. Also remember that .htaccess files control the directory they are in and any subdirectories. Geeks, making the world a better place |
Hi Prashank. Yes you are right, ./cache has a .htaccess in it with "Deny from all", but technically speaking, there's nothing in .htaccess which you can't move to a virtual server config file.
There's a performance hit on Apache scanning for .htaccess files on every request, and for a virtualised environment this does mean performance loss. This is why I'm hoping Boonex or Dolphin users have tackled this one before and there's a real solution for it? ie. if moving the directives to virtual server config, the ones to move and items to create etc.
Just out of interest, if you don't use Apache for Dolphin, what do you use?
you can do that and add the code in the root .htaccess to block cache and tmp directory.
I use Nginx.
so much to do.... |
Hi GG. Thanks. I built Dolphin to run on Apache for complete compatibility, but knowing it's not going to perform the best. But now that the website is near complete, I'm concentrating on performance.
With htaccess files, if you have an image say, n directories down, Apache will look for a htaccess file in each of the n-1 directories just to access that one image. When you have many users online at the same time, this really has a performance hit on the filesystem no matter how much caching Linux gives to filesystem activity. Any hits to the filesystem that can be avoided has a major improvement on site performance.
This is explained better here:
https://muffinresearch.co.uk/avoiding-the-use-of-htaccess-for-performance/
I was just hoping someone had done this before ie. removed htaccess and added to the virtual server host, to chat about the experiences and any potential gotchas.
I would the leave the .htaccess file in the root of the site and let Apache handle it. .htaccess file in the root is used to rewrite the URLs so they are pretty; permalinks. Also remember that .htaccess files control the directory they are in and any subdirectories.
|
Hi Prashank, have you had any problems running Dolphin with nginx directly?
I chose Apache for stability, since that is what Boonex use, but I prefer nginx and actually use nginx in front of Apache as a reverse proxy, which does help with performance.
you can do that and add the code in the root .htaccess to block cache and tmp directory.
I use Nginx.
|