Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Any disadvantage to using .php on a non-php page 1

Status
Not open for further replies.

CliveC

Programmer
Nov 21, 2001
1,222
0
0
US
Is there any disadvantage to naming a page with a .php extension even if the page contains no PHP?
 
Personally I can't see any reason why you shouldn't.
It will still be checked for php but the html will still be parsed correctly.
***************************************
Party on, dudes!
[cannon]
 
well if u dont have any php code i dont see any "advantage"
for giving the extension .php unless u suspect that the page will going to be dynamic in near future.

spookie --------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 
there is a slight disadvantage as gerrygerry mentionned but there might be a few more than we may think depending (I do say depending) on the way pages are processed on the server.

Gzip is a common zip program used by many apache servers. It zips the file to make it smaller when sent via the web. Browsers since version 3.0 can understand a zipped stream. If the extension is .htm .html .xhtml most apache servers are set up to automatically zip the file.

Here is how it happens.

Browser at IP 129.129.129.129 asks for >
server receives the request
>
zips the file for faster transfer (takes little time but packs files between 40%-95%)
>
sends it to 129.129.129.129

If the page is quite large it can save quite a considerable amount of time.

Now lots of servers out there are not set up to handle gzip with php. This means that when you process a page with php it might not be gzipped.

So your process would look like this :

Browser at IP 129.129.129.129 asks for >
server receives the request
>
sends the php file for processing (negligably fast process)
>
sends it to 129.129.129.129

I did a test for a file. It's size went from 3,576 to 1,424 bytes. This means a 2.5 times faster download!

If your server is not set up to gzip php files then it might not be that negligeable after all. You might want to check! :) Gary Haran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top