NYCPHP Meetup

NYPHP.org

[nycphp-talk] web page file extensions

Aaron Fischer agfische at email.smith.edu
Wed Apr 28 11:43:14 EDT 2004


On Apr 28, 2004, at 11:29 AM, Adam Maccabee Trachtenberg wrote:

>> I certainly don't want to make a change that will hurt performance as
>> this is more of an personal aesthetic issue more than anything else.
>> If performance is better given the scenario mentioned, I shall shift 
>> my
>> current aesthetic preferences.  =)
>
> While it is technically slower to have .htaccess parse all HTML pages
> as PHP, I don't believe it should factor into your considerations:
>
> 1) If you're on a shared server .htaccess is either already enabled or
>    disabled. If it's enabled, you're already taking the performance
>    hit regardless whether you map .html to PHP. So, it's essentially a
>    "sunk cost."

Yay, a little economics lingo makes it's way into a php discussion.  I 
love multidisciplinary approaches.  =)

>
> 2) When PHP doesn't find any <?php tags, it just spits out the page
>    unmodified. This is a very small performance hit because there's no
>    complex logic.
>
> 3) People are used to seeing pages in .html and your site should
>    prevent leaking internal middleware choices to the user in the form
>    of file extensions.
>

Re. # 3, this was part of my thinking behind it.  People are 
comfortable with seeing .html and there's definitely something to be 
said for that.  Also, I'd rather not broadcast my coding 
environment/scripting language by using .php extensions.  Doesn't seem 
logical to give any user, much less a potentially malicious one, 
information about your setup when you don't have to.

> There is a mentality in the software developer community that anything
> that impacts performance (or takes up lots of disk space, etc.) is
> automatically something to be avoided. We've come a long way from the
> 1960s: processors are more powerful, hard drives are much larger, RAM
> is plentiful. And it's all cheaper than ever.
>
> We've long since passed the inflection point where hardware resources
> are more expensive than business objectives and developer costs, yet
> we still persist in undervaluing those two assets. Just because
> hardware has a tangible price doesn't mean that it's the only part of
> the process with a cost.
>
> Finally, I can't believe that anyone whose site is running on a shared
> server could ever generate enough traffic that they'd need to worry
> whether binding PHP to all .html pages in an .htaccess file would
> cause a noticeable slowdown. Check and see.
>

Excellent, that makes sense to me.

> Okay. Rant over. Thanks for your patience. :)
>
> -adam

Thanks Adam.

-Aaron




More information about the talk mailing list