Another performance tip if using Apache and you have access to the Apache Config files -
Put the main .htaccess info into the Apache config files.
Depending on which version of Apache this can be done in httpd.conf as a Directory
<Directory "install-directoy of Silvertripe">
Silverstripe htaccess content goes here
This is an improvement in Apache as the htaccess is now in memory and not being read each time a page is accessed.
Do you have any figures on this? I can't see it saving anything more than a few microseconds per request, especially when running under Linux where the .htaccess files are likely to already be cached in memory.
Not saying it won't help, but just wondering whether the cost/benefit makes it worthwhile doing.
Really good to see the performance problem has been solved.
Thanks AlexB...i am going to check my Assets mode...:P
Its really good to see lots people actually working for improving and providing suggestion for a better CMS.
So pleasure to be a part of the community:D
100 milliseconds is not insignificant - it's a tenth of a second. You could do a 100+ simple database lookups in that time.
I would not have thought that is how long it takes to load the file (think about how many files are loaded in one SS page request). Perhaps the time is involved in parsing and processing the file? Something to bear in mind when deploying websites in general. Thanks.
"In general, you should never use .htaccess files unless you don't have access to the main server configuration file. There is, for example, a prevailing misconception that user authentication should always be done in .htaccess files. This is simply not the case. You can put user authentication configurations in the main server configuration, and this is, in fact, the preferred way to do things."
It goes on to explain why, for performance and security reasons.
Of course, it doesn't really matter for a lot of people, but it's an easy performance win (100ms is huge!).