Page 1 of 1
Compressing a PHP file ?
Posted: Tue Apr 03, 2007 4:15 am
by christian_phpbeginner
Hello folks,
I have several questions...
When we compress PHP file, would it load faster on the web ?
What tools to compress a PHP file and where can I find it ? (Sure, I have googled it, but what I found was not a compressor to compress PHP files, infact I found more on PHP files to compress Javascript files.)
Thanks,
Chris
Posted: Tue Apr 03, 2007 4:17 am
by Chris Corbyn
Compressing a PHP file will surely only slow things down. PHP is pre-processed on the server so making the PHP file smaller will not reduce bandwidth. You can use GZip comrpession in Apache to compress returned data streams though.
Posted: Tue Apr 03, 2007 7:25 am
by feyd
You can also look at
ob_gzhandler()
Thank you !
Posted: Tue Apr 03, 2007 2:07 pm
by christian_phpbeginner
Well, thanks for the responses so far.
But, how to prevent someone who works at a web hosting company grab one of your PHP file and use it without your permission ?
Thanks,
Chris
Re: Thank you !
Posted: Tue Apr 03, 2007 2:25 pm
by onion2k
christian_phpbeginner wrote:But, how to prevent someone who works at a web hosting company grab one of your PHP file and use it without your permission ?
You could use an encoder, but ultimately they're reversible to someone who knows what they're doing. The best advice if you're worried about that happening is to either run your own server and not let anyone else have access (lots of extra work), or relax and understand that it's unlikely someone will steal your code, and even if they do there's not much to worry about. If your business
really depends on your source code remaining unique and secret then host it yourself.
You should also remember that there's thousands of very clever people out there who are more than capable of replicating pretty much anything even without access to the code. If your idea is valuable then someone will copy it. Fact of life. Succeed by doing it better.
Re: Thank you !
Posted: Tue Apr 03, 2007 2:54 pm
by christian_phpbeginner
onion2k wrote:christian_phpbeginner wrote:But, how to prevent someone who works at a web hosting company grab one of your PHP file and use it without your permission ?
You could use an encoder, but ultimately they're reversible to someone who knows what they're doing. The best advice if you're worried about that happening is to either run your own server and not let anyone else have access (lots of extra work), or relax and understand that it's unlikely someone will steal your code, and even if they do there's not much to worry about. If your business
really depends on your source code remaining unique and secret then host it yourself.
You should also remember that there's thousands of very clever people out there who are more than capable of replicating pretty much anything even without access to the code. If your idea is valuable then someone will copy it. Fact of life. Succeed by doing it better.
Hi onion2k,
Thanks for the advice and input ! I appreciated it.
Actually, I just wondering about it, because today at a cafe. Me and a view friends of mine gathered and discussed about this, but it seems there is no other way than encode it.
I know that there lots of very clever people out there who can design a system just by viewing the GUI...It's a good thing and it should be, because knowledge is open source.
But to me, it's too bad that the web hosting company could not do anything to prevent their workers from stealing their client's code. But, as you said it, FACT of LIFE !
Posted: Tue Apr 03, 2007 3:36 pm
by RobertGonzalez
That is the case with any company and company data. What is to stop someone that works where I work from taking information off of one of the computers? Nothing. Same holds true for web hosts.
Ultimately, if you are not interested in running your own server, you are usually glad someone has access to the server so when the network pukes or the server dies, someone can fix it for you. It is actually pretty nice to have. But when the rubber meets the road, the hosts have better things to worry about for their business than snagging a customers code and trying to use it for their advantage.
Even moreso when the company has thousands of hosted accounts with many files per account.