Re: Couple of beginner questions
| From: | Eric Butera | Date: | Fri, 09 Jan 2009 20:36:31 +0000 |
| Subject: | Re: Couple of beginner questions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-285903@lists.php.net to get a copy of this message | ||
On Fri, Jan 9, 2009 at 3:22 PM, <ceo@l-i-e.com> wrote:
>
> The slowdown of just running raw HTML through PHP was once benchmarked as about 5 to 10 %.
>
> You could, in theory, use .htaccess and <Files> to ForceType specific .html files as PHP,
> while leaving the rest of your .html files as static.
>
> I am not recommending this, just being pedantic. :-)
>
> Definitely better to either do them all and take performance hit, which is probably irrelevant
> to a beginner, or plan better now and strip .xyz from the URLs.
>
> ymmv.
>
> Personally, I've been quite happy for over a decade running all .html through PHP, on 99%
> of the sites I work on.
>
> If it's big enough to *need* static content, they usually have already gone the route of
> CDN and have static HTML off on those nodes anyway, in my limited experience.
I was just talking myself. I use objects and such so I'm really not
as worried about performance either. But it was a "downside" that I
knew about from some css/js stuff I'd done a while ago. I still had 2
files on my box from some framework stuff I'd been messing with. Here
were some results from my local testing (from the Yii framework).
-- index.html --
$ cat index.html
hello world
$ ab -t 30 -c 50 http://localhost/benchmarks/baseline/index.html
Requests per second: 631.07 [#/sec] (mean)
Time per request: 79.23 [ms] (mean)
Time per request: 1.58 [ms] (mean, across all concurrent requests)
-- index.php --
$ cat index.php
<?php echo "hello world" ?>
$ ab -t 30 -c 50 http://localhost/benchmarks/baseline/index.php
Requests per second: 358.21 [#/sec] (mean)
Time per request: 139.58 [ms] (mean)
Time per request: 2.79 [ms] (mean, across all concurrent requests)