Page 1 of 1

Should PHP code be compressed like javascript for live site?

Posted: Wed Oct 08, 2008 4:24 am
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.

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

Posted: Wed Oct 08, 2008 4:31 am
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.

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

Posted: Wed Oct 08, 2008 1:19 pm
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.