[nycphp-talk] Minimal overhead
David Krings
ramons at gmx.net
Sun Sep 2 09:25:41 EDT 2007
Elliotte Harold wrote:
> Suppose I don't want it to be so obvious that I'm using PHP on a site,
> Or that I just want the freedom to not always use PHP in a given
> document. Thus I decide to configure Apache to treat all .html files as
> PHP files.
>
> How much overhead does this add for the common case when a file only
> contains static data, no PHP? Would I notice the hit?
>
As usual, it depends. All pages will be sent to the PHP interpreter
which parses the file and decides that there is nothing to do and has
the web server serve the static content. While there may be no
noticeable difference when calling one page it may come into play when
you get several thousand hits a minute.
What's so wrong with calling files .htm and .php and handle them
differently? Although, I can ask the opposite question and come up with
some good answers as well. I'd take a look as to how busy the site is
and how much oomph your server box has. Or just try it out and see what
happens.
I came across several instances where I crafted a page as static, but
then wanted to add a header and then internationalization based on user
preference. At that point there isn't a way around PHP. Chances are that
you will use PHP at some point even for pages that are currently static.
David
More information about the talk
mailing list