[TYPO3-performance] Super simple mod_rewrite config, super fast backend!
Michiel Roos [netcreators]
michiel at netcreators.com
Thu May 7 13:10:15 CEST 2009
Hi,
Yesterday is occured to me that it is nonsense to have mod_rewrite
figure out if it has to rewrite stuff or not.
It is better not to bother mod_rewrite with static items at all.
What do we not want to push through mod_rewrite?
- /typo3/*
- /typo3conf/*
- /typo3temp/*
- /fileadmin/*
- /uploads/*
- /clear.gif
- /favicon.ico
- /index.php
The rest (all realurl uri's) we DO want to push through to mod_rewrite.
We no longer need mod_rewrite to check if something is a file, dir or
link. Since all we push through is realurl stuff.
This gives us the following snippet for inclusion in your vhost
configuration:
<LocationMatch
"^/(?!(typo3(/|conf|temp)|fileadmin|uploads|t3lib|clear.gif|index.php|favicon.ico))">
RewriteEngine on
RewriteRule .* /index.php [PT]
</LocationMatch>
You can now disable .htaccess in vhosts (AllowOverride None).
You can see a big difference between rewrite activity if you turn on
rewrite logging.
Speed improvements are hard to measure here
Old config:
Requests per second: 218.30 [#/sec] (mean)
New config:
Requests per second: 224.81 [#/sec] (mean)
Comments? Test results?
--
Michiel Roos
TYPO3 Developer
06 458 7 8 9 10
________________________________________________________________________
Netcreators: Open Source, Open Minds, Open People
________________________________________________________________________
More information about the TYPO3-performance
mailing list