php - Does .htaccess Rules Increases Load Time? -
Does the rule increase the load time on the server in the .htaccess file? I am confused. I tried to search about it but the result shows the benefits of caching etc. Is the re-written URL index.php helpful or does it increase server load time?
Is it better that redirection through PHP routing library instead of .htaccess?
Yes, the rules of .htaccess increase response times.
But do not worry about a single redirection rule, unless you have to give a high performance system
.htaccess files are read on every request. If you have a complex directory hierarchy, all .htaccess files are included and parsed on each request (from top to bottom). A redirection is a new request, so files are re-parsed.
Large files, many files, really complex regexp rules, multiple redirection.
Keep your .htaccess compact, small and simple.
Comments
Post a Comment