Should PHP code be compressed like javascript for live site?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sermer8455
Forum Newbie
Posts: 1
Joined: Wed Oct 08, 2008 4:06 am

Should PHP code be compressed like javascript for live site?

Post by sermer8455 »

I hope I don't post in wrong thread.

I want know should PHP code to be compressed like javascript code in live server for sake of optimization and faster processing of code?
If so, then I want to ask if anyone know the name of tool to compress PHP code?

Also I want to know too if I remove all comments from PHP code (/*..*/ or //), does it help optimizing the server processing too?
Does obsfucated PHP code would affect the performance of code?

Sorry for my bad english, I hope you understand what I am talking about,
Thanks in advance.
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Should PHP code be compressed like javascript for live site?

Post by aceconcepts »

Not sure about compressing php files but I always find its good practice to keep comments in php files on the remote site as well as local machine - otherwise you'll be face with ultimately different files and one will be overwrittend when editing.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Should PHP code be compressed like javascript for live site?

Post by califdon »

I don't think there is anything to be gained by compressing server scripts. They are executed on the server, not sent over the Internet and not processed by the client browser. I can't imagine a server script that is so complex that the server's efficiency could be improved by such methods.
Post Reply