News for hackers. Stuff that matters.
Re:Link: A fast and simple PHP Router by 127001brewer on Thursday May 29, 2014 @01:30PM (#7817419)
How complicated were the Etsy routes? And were the added overhead and complexity?

And I know it is a pain to restart Apache each time there's a change to the configuration file, but does anyone know the time differences between a PHP router and Apache rewrites?

Re:Link: A fast and simple PHP Router by mcfunley on Thursday May 29, 2014 @02:23PM (#7817744)
Basically just "/listing/<a number>/<some ignored text> goes to listing.php", multiplied by a thousand pages or so.

There's overhead associated with doing the bookkeeping necessary to compute the route lookups. In practice, it's not that awful to just write a function like "get_url($listing_id)" by hand, and debugging this later is much more straightforward.

We didn't need to restart httpd (in development at least) to add to .htaccess. For production deploys maybe we were configured to do this, but that's hidden from development.

Re:Link: A fast and simple PHP Router by icedchai on Thursday May 29, 2014 @01:31PM (#7817436)
Put it in .htaccess. No restarts needed.
Re:Link: A fast and simple PHP Router by 127001brewer on Thursday May 29, 2014 @01:38PM (#7817476)
That's correct - I was thinking of using an Apache VirtualHost file. (Isn't using the .htaccess file slower(?) than using the VirtualHost file?)
Re:Link: A fast and simple PHP Router by icedchai on Thursday May 29, 2014 @01:45PM (#7817525)
It is slower, since .htaccess is parsed on every request. (However, it is probably faster than routing through PHP code.)
Re:Link: A fast and simple PHP Router by rdam on Thursday May 29, 2014 @02:41PM (#7817829)
You can reload Apache without a restart (apache2/httpd graceful/reload depending on your distro).