|
Posted by Michael Fesser on 11/09/06 16:56
..oO(Jerry Stuckle)
>Michael Fesser wrote:
>
>Also, I have some customers with .php pages which really are static.
>But why use PHP for some other function such as processing form data.
There are many more nice things I use PHP for, even if the output may be
static (for a while). If I can use a tool and get some benefits from it,
I use it.
>Also, he never said *all* his pages were static. Telling the web server
>to process *all* .html files as php files is an unnecessary overhead.
Who cares? That's what a server is for. You won't be able to notice a
difference in time between a plain HTML file delivered as-is and another
HTML file, parsed by PHP. Even with PHP-(Fast)CGI the difference is too
small. The transfer over the network takes much more time.
And BTW: Unnecessary 301 redirects are no overhead? Not much for the
server, but for all the clients and the network.
>> But of course you can also use SSI if you like - just configure the
>> server to parse .html files for SSI directives. And if you want to use
>> it all at the same time, you can do that as well:
>>
>> http://example.com/static.html
>> http://example.com/phpscript.html
>> http://example.com/perlscript.html
>> http://example.com/ssi.html
>>
>> It just depends on the server configuration (in this case for example
>> with content negotiation and MultiViews).
>>
>Yep, and the more you tell the server it has to parse, the more CPU time
>it takes.
That's his job.
>> That's a broken design. There are many valid reasons to keep all such
>> technical stuff out of URLs.
>>
>Not at all. No "technical stuff" in the url at all. You're just
>redirecting index.html to actually retrieve index.php instead.
A 'php' in the URL is technical stuff that doesn't belong there. A URL
describes a resource, not details about the way it is generated.
>No extension?
Exactly. Reliable, long-living (in other words: "cool") URLs don't need
an extension, simply because it avoids a lot of problems.
>UGH - no, DOUBLE UGH! Vomit! Wash your mouth out with soap!
>
>Extensions were created for a purpose - to let the server know what
>needs to be handled by which processors.
Concepts like "directory", "file", "extension" don't exist in URLs.
A URL doesn't describe a file, but a resource.
You only need an extension if you directly map a URL onto the server's
filesystem. That's the most common, but not the only way. Of course on
the server the files still have their extension, but there's no need to
show it in a URL.
>To bypass that creates a
>completely unnecessary load on the server.
If your server gets into trouble because of some little lookups and
simple pattern matching then you have a _real_ problem.
You should care more about your clients (users, search engines) than
about the server and make things as easy as possible for them. Using the
right tools at the right time to satisfy the clients, that's the whole
point. Ignoring these tools just because they may cause some more CPU
load now and then is - sorry - stupid (no offense intended).
Micha
Navigation:
[Reply to this message]
|